Normally the return path is set by sendmail (or whatever the server is running, qmail, etc.)

However you can pass a fifth argument to php’s mail function to reset it to what you want. Here’s an example:

$result = mail($to, $subject, $body, “From: $from\n”, “-f$from”);

make sure you do not put a newline in after the fifth argument’s from. php will error out.

One Response to “How to modify return-path header in php mail function”

  1. Marcelle Says:

    You would not believe how long I searched for this information. Thank you


Leave a Reply