PHP Mail - How to specify a "Fail to" address?
Posted: Sat Sep 25, 2010 9:20 pm
Hi all,
Quick and probably stupid question here, but I've been Googling for an hour and can't find the answer - When using the PHP mail function, how do you specify the address to which a bounced message alert is sent?
I want it to be different than the sender of the message; ie. users are filling out a web form to send comments via email to a local politician, and I want successfully delivered messages to appear to come from the user (of course, since that's who's sending it)... but I want failed emails to bounce to me.
I've got it working fine where the emails are sent to the proper address, and come FROM the user's address, and reply-to the user's address... but it seems that if I don't specify a failure address, they'll probably either fail to the user, or to my server admin, right?
I find promising mentions in the php docs of -f and envelope-sender attributes in the headers section of the mail function, but the docs don't do a good job of explaining what those are or how to use them.
Any suggestions?
Thanks...
Joe
Quick and probably stupid question here, but I've been Googling for an hour and can't find the answer - When using the PHP mail function, how do you specify the address to which a bounced message alert is sent?
I want it to be different than the sender of the message; ie. users are filling out a web form to send comments via email to a local politician, and I want successfully delivered messages to appear to come from the user (of course, since that's who's sending it)... but I want failed emails to bounce to me.
I've got it working fine where the emails are sent to the proper address, and come FROM the user's address, and reply-to the user's address... but it seems that if I don't specify a failure address, they'll probably either fail to the user, or to my server admin, right?
I find promising mentions in the php docs of -f and envelope-sender attributes in the headers section of the mail function, but the docs don't do a good job of explaining what those are or how to use them.
Any suggestions?
Thanks...
Joe