Enable PHP mail () function in Ubuntu and troubleshoot sending mail slow, ubuntu email _php Tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.