What to do if the mail function in Linux cannot send a message

Source: Internet
Author: User
Tags fpm

Cause Analysis:

1. Check if the 25 port is open
2.mail is the use of the Linux SendMail service to send mail, service SendMail status to view the status of the service

Send command: mail-s-V "hell" [email protected] < Test.txt

SendMail components are not installed or started

1. Reinstall the SendMail component, I use CentOS, install it using the following command

Yum Install SendMail

2. Restart the PHP-FPM process using the following command

/ETC/INIT.D/PHP-FPM restart

3. Check if the SendMail is operating properly

/etc/init.d/sendmail status

If the display is running running, you can.

Commands that may be used

/etc/init.d/sendmail start (Start SendMail)

/etc/init.d/sendmail Stop (SendMail off)

/etc/init.d/sendmail Restart (restart SendMail)

4. Configure php.ini, fill in the absolute path of the SendMail

To open an edit php.ini using a command

Vi/usr/local/php/etc/php.ini

Input? Sendmail_path find location (or manually jump to find Sendmail_path), you will find that the default is the following code

; Sendmail_path =

Press I to enter the edit, change this line to

Sendmail_path =/usr/sbin/sendmail-t-I.

Press ESC to exit edit, enter: Wq Save exit

5. Restart the PHP-FPM process

/ETC/INIT.D/PHP-FPM restart

What to do if the mail function in Linux cannot send a message

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.