Hi,
I'm building a website that sends and email to a user when he registers.
My code (the gist of it):
<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! \nThis is a simple email message.";
$headers = "From: [email protected]";
$headers .= "\r\nReply-To: [email protected]";
$headers .= "\r\nX-Mailer: PHP/".phpversion();
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
the problem is that when the mail is delivered, the from header remains [email protected]
, while reply-to gets changed to the specified value.
box347.bluehost.com
is the hostname of the server on which the website is hosted.
So what am I doing wrong? What can I do to get the "From" address the same as the reply-to address?
Is it something I'm doing wrong, or is the web host playing foul?
Thanks,
jrh