I am sending out ~30k email messages.
Each message will have slightly different content.
I have read that using the php mail()
function is not a goo
firstly, people who say php mail()
is a bad idea don't really know how to use it correctly, With php mail, it gives the developer the opportunity to send extremely basic messages with lack of concrete headers.
if you look at the PHP Documentation for mail()
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
The 4th
and the 5th
parameters allow you to supply header and additional information, these are what you should be looking into to get decent emails sent from php's Mail function.
The reason a lot of mail is never successful is because the recipient's mail system is blocking the email as spam or malformed because the headers aren't correctly build or lack important headers.
my advice would be to take a look at this OpenSource application called OpenCart, if you download the application and extract the library called Mail
.. you can use this to send mail, it supports SMTP And PHPMail, But also takes care of headers so the the message is legitimate email and should not trigger a spam filter.
An example of who marks mail as spam if the headers is myself, as we run an Exchange 2010 server any mail that comes in without a Content-ID
header is automatically marked as span.
As i stated at the top, there's nothing wrong with PHP mail, its just the developer overlooking important facts.
You can take a look at the class directly from here, if you look out for the line that highlighted you will see what I mean.
http://pastebin.com/nJi8Ms4Y6