Enable the PHP mail () function in Ubuntu and troubleshoot slow sending of mail
This article mainly introduces the method of installing SendMail under Ubuntu, as well as the reason and solution of the slow sending of the mail after the SendMail is enabled, the small partners who need it can refer to it.
If you need to use the PHP mail () function to send mail, it is necessary for the server to install the SendMail component to support, this is in the PHP manual in the Mail () function section is also described. And then in
To install the SendMail command under Ubuntu:
The code is as follows:
sudo apt-get install SendMail
After installation, start the SendMail service:
The code is as follows:
sudo service sendmail start
With SendMail support, you can send mail in PHP with the Mail () function.
Generally cause in PHP with mail () to send the message slow reason, is the DNS resolution is slow, and often because the server's hostname is not a real resolvable domain name.
The code is as follows:
sudo vim/etc/hosts
Then press the I key, and then you can modify the code. Add Localhost.localdomain and your host alias in the 127.0.0.1 section, and then press ESC to exit the edit state, then enter ': Wq ' to save and exit.
Finally restart the next SendMail service:
The code is as follows:
sudo service sendmail restart
The above is the whole content of this article, I hope you can enjoy.
Please take a moment to share the article with your friends or leave a comment. We would be grateful for your support!
http://www.bkjia.com/PHPjc/975119.html www.bkjia.com true http://www.bkjia.com/PHPjc/975119.html techarticle Enable the PHP mail () function in Ubuntu and resolve the slow sending of messages this article mainly introduces you to the method of installing SendMail under Ubuntu, as well as enabling SendMail, PHP to send mail ...