Page 1 of 1

mail() - headers

Posted: Tue Nov 22, 2005 9:42 am
by Ree
What are the recommended headers to use with mail()? I'm having a problem sending emails to some email accounts, so I wonder maybe I do not include some header which might be required?

Posted: Tue Nov 22, 2005 9:51 am
by neophyte
Some of the email clients (MSN) don't allow for a blanket email from PHP's mail() function. I use phpMAILER a class available on source forge. It does a great job setting all the headers and allowing different ways of mailing besides just mail(). Hope that helps.

Posted: Tue Nov 22, 2005 9:54 am
by Buddha443556
Date? Some ISP will bounce or even blackhole an email for lack of a date.

To, From, Reply-To, Date, X-Mailer ... that's usually all I include.

Have you check SPEW and the other blacklist for your server's IP?

Posted: Tue Nov 22, 2005 10:16 am
by AGISB
I also use phpmailer.

The reason for the mails that are not delivered is that they are considered spam. The reason is that mail() sends the email to sendmail and sendmail sends it to the recipients. Sendmail however rewrites the header and that is bad for some spam filters. phpmailer sends the mail itself so that problem does not exist.

It is so funny that even the biggest companies send me mail directly to a trash folder because they are not aware of this problem.

Posted: Tue Nov 22, 2005 11:36 am
by Ree
Well, I'm sending mail from my Windows machine, and it uses my ISP's SMTP server for that, so it's not sendmail. I'll try adding date and X-Mailer. Btw, X-Mailer - it indicates what was used when sending mail? What should I include there?

Posted: Tue Nov 22, 2005 11:37 am
by Charles256
yeah,a lot of my e-mails get blackholed too...even with phpmailer....i give up on getting them all through. I'm happy with a 50% success rate. LOL

Posted: Thu Nov 24, 2005 2:15 am
by AGISB
If your mails are rejected even with phpmailer means that your mail setings are incorrect or that there is no mx-record for your mail sending machine. Many ISP check if they can reroute to the machine. if they can't the mail is moved to spam or rejected.