On Thu, 28 Nov 2002 17:54:46 -0000, you wrote:

>Is it possible to detect with PHP whether an email sent using the PHP
>'mail' function has bounced back or has not been delivered?


If you're using PHP on a unix/linux with sendmail you can set the
envelope sender via the 5th parameter to the mail function,
additional_parameters.  Normally the envelope sender is the username
that your web server process runs under (usually "nobody" if you're
using Apache), but you can set it to either your email address or an
email address you have setup specifically to catch bounces.  Example:

mail('[EMAIL PROTECTED]', 'Test email', 'This is a test', '',

Most MTA in existence will route DSNs to the envelope sender, not the
From: header.

Note that sendmail will add an X-Warning header if the user your web
server runs as isn't considered a sendmail "trusted user".  The
quickest way to fix this (on Redhat machines anyway) is to put the
username in /etc/mail/trusted-users.  Other systems and sendmail
installations may differ, so YMMV.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to