i’m looking for a email library for building up a newsletter system inside our company.
it should support message queuing (feeding mails to the queue, automatic mailing in the background) without blocking the webserver.
so i think background processing should be run as background service on the server,
similar to aspmail but for php.
any suggestions?
thanks
I’ve used PEAR’s Mail_Queue to queue up 200,000+ mails at a time. Populating a database is easy and quick, even with customised content, and then a fairly simple script sends around 250 a time – if the load average isn’t too high. Then it loops around and sends the next batch. That runs from the background, and Its easy to set so that if the queue table is empty, it pausing for a moment before it checks again (because checking several times a second won’t help anyone).
The advantage of also checking the load average of the machine is that it will just crunch through the queue without any problems of self-created resource starvation.
The Mail_Queue tutorial gives you almost everything you need – just loop around th ‘send_messages.php’ script (from the command line is better) until the database queue is empty, then pause a while – and loop again.