|
Posted by Geoff Muldoon on 10/17/06 23:30
postmaster@127.0.0.1 says...
> for some reason it seems PHP is not properly passing the sender's
> address to sendmail. It does not matter whether I add "From" as header,
> "nobody@new" is always taken as originating addres (be it return-path,
> from or sender).
>
> sendmail logs the following line
>
> SMTP error from remote mailer after MAIL FROM:<nobody@new>
>
> Is this due to a wrong sendmail configuration or would I need to change
> something within PHP?
Try:
$to = "me@testaddress.com";
$subject = "this is a test";
$body = "test 123";
$headers = "From: me@sendaddress.com";
$params = "-f me@sendaddress.com";
mail($to, $subject, $body, $headers, $params);
Notice the fifth parameter with the -f setting. This is used in many
sendmail installations to set a "canonical" from address, setting it
purely in the headers is often ignored as it can be used as a common
spam/spoof exploit.
Geoff
Navigation:
[Reply to this message]
|