Forum Moderators: coopster
$headers = "Return-Path: <me@mydomain.com>\r\n";
$headers .= "From:Me <me@mydomain.com>\r\n";
$headers .= "Reply-To: Me <me@mydomain.com>\r\n";
$headers .= "X-Mailer: My Mailer\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain\r\n\r\n";
mail ($to, $subject, $body, $headers);
But when the emails get delivered, the Return-Path header is set to: apache@serverhostname.mydomain.net
All other headers are set correctly.
Where am I going wrong?
it is hard set in the php.ini sendmail_from
I have actually sorted the problem now. In the end, I edited sendmail.cf to treat apache as a 'trusted user' and then created a file in the httpd/conf folder to give the sendmail_from and sendmail_path new values. It means it's set for the entire site rather than for individual scripts, but it will do me.
Thanks for your help.