Phone: 858-565-2171
Control Panel Login

 

How can I get emails that bounce, when using the PHP mail() function, to go to a particular email address?

How can I get emails that bounce, when using the PHP mail() function, to go to a particular email address?

When sending email messages using PHP, you must set the envelope sender in order to have bounces handled correctly. In order to set the envelope sender, use the -f sendmail option in the additional_parameters parameter of the mail command. Here is an example:

mail("to@example.com", "subject", "body of message", "From: sender@example.com", "-fsender@example.com");

Without the last parameter, "-fsender@example.com", bounces would come back to a system administrator account, instead of the From address, which is usually not what is intended.

Refer to the PHP documentation for more info:
http://php.lamphost.net/manual/en/function.mail.php