views:

461

answers:

3

a simple question: which one has good performance for sending mails in bulk?

mail() function or sendmail

which one is used by popular PHP list manager packages?

+2  A: 

Well the mail() function is not really suitable for emails sent in bulk because it opens and closes an SMTP socket for each email you send, which is far from being efficient. If you look at PEAR::Mail it allows you to use 3 backends: mail, sendmail and plain SMTP. For what it's worth, I've personally preferred SMTP because it's easy to support on both Linux and Windows.

If you wish to send mails in the background using a queue, PEAR::Mail_Queue might be a solution.

JP
+1  A: 

sendmail is a Mail Transfer Agent (MTA). On UNIX and Linux based systems, PHP's mail() function simply relays the email though sendmail (or a compatible MTA). For sending bulk email, you may want to look into directly connecting to an SMTP server. Zend Framework provides an SMTP transport.

Jordan Ryan Moore
Thanks for elaborating on send-mail, especially on Unix and Linux.How does Windows handle this though?
Newb
A: 

If you are running the SMTP mail server yourself, make sure you have SPF and domain keys set up properly or your mail will end up in the junk box for most large domains (yahoo, gmail etc).

Also don't forget about bounce handling and robust unsubscribe functionality. Without those your email blasts will be much less effective, and your IP will get blacklisted.

And of course don't allow open relays. Do your homework and tread with caution, spammers have made it difficult for us.

Byron Whitlock