Page 1 of 1

html mail()

Posted: Sat Jun 18, 2005 6:26 pm
by Jim_Bo
Hi,

Im using the following for html mail().

It works except when you read the mail in "from" is says:

account_username@webhoster.com

Rather than the persons email who submited the form, also its the same when reply is hit.

Code: Select all

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "$name <$email>";
$to = 'Bla<bla@bla.com>';
$subject = "Re: Online Registration";
$message = '<font size="2" face="tahoma">Hi Admin<br><br>
Record Id: '.$id.'</font>';

mail($to, $subject, $message, $headers);
How should it be so it has "$name $mail" in the "from" box and also uses "$name <$mail>" in the reply address?

Rather than having my username@mywebhoster.com?


Thanks

Posted: Sat Jun 18, 2005 6:57 pm
by Skara

Code: Select all

$headers .= "$name <$email>";
that doesn't make any sense...

Code: Select all

$headers .= "From: $name <$email>\r\n";
$headers .= "Reply-To: $name <$email>\r\n";

Posted: Sat Jun 18, 2005 7:09 pm
by Jim_Bo
Hi,

That works ..

thanks