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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With