RT : Does your website add features or solve problems?
Jan, 2010
21

PHP Mailer Stuffs FTW

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!

Post to Twitter Tweet This!

This entry was posted on 01.21.2010 at 3:32 am and is filed under Code Bin. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Comments

Leave a Reply

Green Web Hosting! This site hosted by DreamHost.