2019-10-15 09:35:06 SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed.
After installing the following tutorial, mail() shows success, but the test message is not actually received.
1、Reinstall the sendmail component, I am using CentOS, use the following command to install
apt-get install sendmail
2、Restart the php-fpm process with the following command
/etc/init.d/php-fpm restart
3、Check if sendmail is working properly.
/etc/init.d/sendmail status
If the display is running running, you can.
Possible commands
/etc/init.d/sendmail start (starts sendmail)
/etc/init.d/sendmail stop (closes sendmail)
/etc/init.d/sendmail restart (restart sendmail)
4、Configure php.ini and fill in the absolute path of sendmail
Use the command to open the edit php.ini
Vi /usr/local/php/etc/php.ini
Enter ?sendmail_path to find the location (or manually jump to find sendmail_path), you will find the default is the following code
;sendmail_path =
Press i to enter the edit and change this line to
Sendmail_path = /usr/sbin/sendmail -t –i
Press Esc to exit editing, type :wq to save and exit
5、Restart the php-fpm process
/etc/init.d/php-fpm restart
2019-10-15 09:35:06 SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed.
After installing the following tutorial, mail() shows success, but the test message is not actually received.
1、Reinstall the sendmail component, I am using CentOS, use the following command to install
````
apt-get install sendmail
````
2、Restart the php-fpm process with the following command
````
/etc/init.d/php-fpm restart
````
3、Check if sendmail is working properly.
````
/etc/init.d/sendmail status
````
If the display is running running, you can.
Possible commands
````
/etc/init.d/sendmail start (starts sendmail)
/etc/init.d/sendmail stop (closes sendmail)
/etc/init.d/sendmail restart (restart sendmail)
````
4、Configure php.ini and fill in the absolute path of sendmail
Use the command to open the edit php.ini
````
Vi /usr/local/php/etc/php.ini
````
Enter ?sendmail_path to find the location (or manually jump to find sendmail_path), you will find the default is the following code
;sendmail_path =
Press i to enter the edit and change this line to
````
Sendmail_path = /usr/sbin/sendmail -t –i
````
Press Esc to exit editing, type :wq to save and exit
5、Restart the php-fpm process
````
/etc/init.d/php-fpm restart
````
website: http://www.flammabilitytest.com