It took me almost 5 hours to find a solution to this one simple problem. I don’t know why this is not more clearly documented, but I figure I will post it up here for everyone to see. Im sure spam mailer people will love it.
When useing PHP code to send a mail you can apply a variety of arguments, the one argument that is rarely seen is the “Return-Path” argument. This argument sets where the “bounced” email will be delieverd back to. In trying to get this working I discovered that this argument does not work well on all servers so I found a command line that you set under the “additional_paramaters” argument to provoke the server into overwriting the default “Return-Path” header.
mail("a@a.com", "Subject", "Message", "From: a@a.com", "-fa@a.com");
Note that “-f” is placed before the email address in the additional_paramaters argument.
Anyway, I just felt like sharing because it took me so long to figure it out.
Cheers!





