bradgrafelman;11035011 wrote:Er... what? The whole point the Sender header exists is so that you are able to specify a different address from the 'From' header.
It's been awhile since I was wrangling with the mail() function and having mail delivery trouble but, as I recall, having these two values be different resulted in a higher spam score which would result in the email going into the junk. I could be remembering incorrectly and I know that the point of Sender is so that you can specify that the email was actually sent by someone other than the person it is from. At the same time, exploiting this is an obvious way to try and conceal spam. Also, I seem to recall that the Sender header might be set by the server itself so manually specifying one could lead to trouble? Sadly, I cannot recall the particulars. Perhaps we could arrange a test...
My primary point was that using PHPMailer or PEAR::Mail sort of eliminates the need to create any mail headers yourself and that your script can send email just like you would yourself -- by logging into a mail server, authenticating, and submitting the message.
It's also helpful set up an SPF record.