...

View Full Version : mail() sending issue



MatesOnline
09-29-2004, 04:40 AM
Hi guys

im having a problem using mail() .. again lol

heres my code


$email = $_POST['email'];
$username = $_POST['username'];
$message = 'Registration Successful, You can Now Login<br>';
$message .= "Your password has been sent to $email";
$ToEmail = $email;
$ToName = $username;
$ToSubject = "MYSITE Registration";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-type: text/html; charset=iso-8859-1\r\n";
$EmailBody = " Thank you for joining our community !";
$EmailBody .= "<br>";
$EmailBody .= "Your password is <b>REMOVED</b>";
$EmailBody .= "<br>";
$EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
$fromname = "MYNAME";
$from = "USER@MYDOMAIN.CO.UK";
mail($ToName." <".$ToEmail.">",$ToSubject,$EmailBody,"From:".$fromname."<".$from.">");


is that the correct format ?

MatesOnline
09-29-2004, 05:27 AM
Hi guys.. solved it .... well almost !

$ToSubject = "mysite Registration";
$from = "me@mysite.co.uk";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: ME <$from>\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$EmailBody = " Thank you for joining our community !";
$EmailBody .= "<br>";
$EmailBody .= "Your password is <b>removed</b>";
$EmailBody .= "<br>";
$EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
$fromname = "Me";
mail($username." <".$emailaddress.">",$ToSubject,$EmailBody);

it sends a message although it is showing Nobody as teh sender . its not displaying my name

any ideas guys ?

MatesOnline
09-29-2004, 06:11 AM
solved :)



$ToSubject = "MySite Registration";
$from = "me@mysite";
$fromname = "My Name";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ME <me@mysite.co.uk>";
$EmailBody = " Thank you for joining our community !";
$EmailBody .= "<br>";
$EmailBody .= "Your password is <b>removed</b>";
$EmailBody .= "<br>";
$EmailBody .= "To change your password login and go to Edit Profile -> Change Password";
mail($emailaddress,$ToSubject,$EmailBody,$headers);


as you may notice i changed the mail($emailaddress,$ToSubject,$EmailBody,$headers); bit.

also i forgot to add $headers lol Doh!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum