This article describes how to use the php function mail to send a mail.
PHP manual says
It is worth noting that the mail() function is not suitable for
larger volumes of email in a loop. This function opens and closes an SMTP
socket for each email, which is not very efficient.
For the sending of large amounts of email, see the » PEAR::Mail,
and » PEAR::Mail_Queue packages.
Don’t worry about that if you use postfix instead of MTA, because postfix handle all mails with a mail queue.
The PHP function mail is:
It depends on the system command sendmail. postfix is a portage contains the sendmail command. Though some other portages (like sendmail portage on Ubuntu) also work, I recomment postfix because it’s secure, fast, easy to administer drop in replacement for Sendmail (MTA).
To install postfix on Arch, use this command:
Or, install it on Ubuntu, use this:
If you have installed sendmail, you need to uninstall it at first:
That’s all. Now write a test script to test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Postfix has a mail queue to handle your mail. This is fatabulous!
1 2 3 4 5 6 7 8 9