Brian Hansen wrote:

Our company is merging with another company and newsletter now needs to go
out to more than 100.000 people. Before it was only a couple of thousands.

I have developed a mail queue using a database and a cronjob, but I am not
in doubt as to what particular solution I need to implement.

I have been running some tests with PHP mail() function, PHPMailer and
PEAR:Mail using 6000 mails at once.

Here's a sumarry of some of the results:

PHP mail() send out 6000 mails in 1.75 seconds.
PHPMailer using PHP mail() send out 6000 mails in 1.87 seconds.
PHPMailer using SMTP send out 6000 mails in 12 seconds (Error without
PEAR:Mail using PHP mail() send out 6000 mails in > 20 seconds (Apache
reached 100% during this time).

Running several test on PHPMailer using SMTP failed completely with more
than 1000 mails.

Everywhere on the net I read that sending out mail using PHP mail() is slow
and it is a bad idea and that using some mail class with SMTP directly would
be much better. I have tested the run my tests with Postfix as the SMTP.

I have gotten the best results using PHP mail(). When the volume is belove
6000 PHP mail() is by far the fastest.

Would someone mind sharing experience and perhaps shedding some light on
this issue?

What is the best solution in real life dealing with huge amounts of mail?
PHP mail() vs. some class using SMTP or binary sendmail (or wrapper)?

All insights would be appriciated.

Best regards.


I won't debate the same as everybody else - but you can save yourself some headaches in 2 simple ways:

1: forget using PHP and just sign up for one of the many professional bulk mail services who specialise in this [if in doublt count up your (hours spend * hourly rate - cost of service) and thats how much you'll save - let alone headaches

2: if your like me and want to just do everything for the sake of learning then send each email to chunks of 100+ or so people by adding them all in the bcc header field; then every single call to "mail()" will be 100x more productive

side notes:
off-list I'm going to send you a class i made a couple of years ago which popen's sendmail via the command line and sends through a raw mime encoded email to multiple recipients extremely quickly and without error - was the best implementation I could get after much testing and playing for weeks - not saying you should use it, but it is packed with comments and notes you may find useful - linux only uses sendmail

note 2: remember you're spf!



PHP General Mailing List (
To unsubscribe, visit:

Reply via email to