Enable the PHP mail () function in Ubuntu and troubleshoot sending mail slow issues, Ubuntu send mail
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:
Copy the Code code as follows:
sudo apt-get install SendMail
After installation, start the SendMail service:
Copy the Code code 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.
Copy the Code code 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:
Copy the Code code 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/974671.html www.bkjia.com true http://www.bkjia.com/PHPjc/974671.html techarticle Enable the PHP mail () function in Ubuntu and solve the problem of sending mail slow, Ubuntu send mail if you need to use the PHP mail () function to send mail, it is necessary for the server to install SendMail components ...