Many sites need to use the SendMail function to send activation mail, in the CentOS built-in sendmail module, direct call can, if encountered problems, can be detected and resolved by the following two steps:
1. Command line Input: echo "This is Test mail" | Mail-s ' Test mail Title ' [email protected]
In general,[email protected] This mailbox can receive a message titled "Test Mail title" with content "This istestmail" and the sender is your user name. If you do not receive the message, the SendMail function has a problem, according to the corresponding situation can be resolved.
2, generally send the message we want to specify the sender, you can edit the php.ini file, remove the Sendmail_path comment, and then change to: Sendmail_path =/usr/sbin/sendmail-f [email Protected]-t-i
where [email protected] is the sending mailbox you want to specify.
After the modification, save, and then restart the PHP-FPM, test can be.
Reference: http://www.xj123.info/4047.html
CentOS 6.5 send mail via PHP function sendmail