Hi,
I am trying to send an email from within my php file, using the mail()
function and have a question:
I used something like:
$mail_to = "you@yourdomain.com";
$mail_subject = "Testing email";
$headers = "Content-type:text/html;charset=iso-8859-1\r\n";
$headers .= "From :".$_SESSION['Email']."\r\n";
$mail_body = '<html><body>blah blah blah ...</body></html>';
if (!mail($mail_to, $mail_subject, $mail_body, $headers))
echo "I failed!";
I do receive the email. However, instead of the email coming from
$_SESSION['Email'], it shows as coming from the sender's mail server
(e.g. domain_name@some_weird_name.primary-server.net).
What am I doing wrong?
TIA.