You are here: Re: mail not working « PHP Programming Language « IT news, forums, messages
Re: mail not working

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация