Is there a way to set the Return-path when sending mail through authenticated SMTP using PHP? I want bounce mails to be caught by another e-mail address than the "from" address.
I know that there is a way to do this with the "normal" PHP mail() function (by setting the "-f" flag in the 5th parameter), but I have no clue how to manage this with SMTP.
Also tried PEAR's Mail-package, but setting Return-path in the headers didn't do the job.
Set the fourth
mail()
-parameter (additional_headers
) to"Return-path:[email protected]"
.Example:
You can see that you separate multiple
additional_headers
with\r\n
(newlines).See also: http://php.net/manual/en/function.mail.php