WordPress knowledge sharing

Solution to the problem that contact form 7 in the lnmp environment cannot send mail

A friend installed contact form 7 on his website to receive customer inquiries, but failed to receive emails after repeated tests. After thinking, Weieis Blog believes that the mail function of vps in the lnmp environment can't send mail normally. The solution is to reinstall the sendmail component. Let's talk about the lnmp environment Contact form 7 cannot send email The resolution process of.

The following operations passed the test in Linode and CentOS. The virtual host on bluehost is not suitable for this method

1. To prevent the sendmail component from being installed before, we need to remove the sendmail component first.

yum -y remove sendmail

Run the command to install sendmail components.

yum -y install sendmail

2. Restart the php fpm process

/etc/init.d/php-fpm restart

3. Start sendmail

/etc/init.d/sendmail start

A friend said that the startup speed is slow. Anyway, I show that running is running in a few seconds, so it can be used.

4. Check sendmail status

/etc/init.d/sendmail status

5. Modify php. ini to enter the absolute path of sendmail. Use the command to open and edit php.ini

vi /usr/local/php/etc/php.ini

Enter? Sendmail_path search location, you will find the following code

; sendmail_path =

Press i to enter editing, and change this line to

sendmail_path = /usr/sbin/sendmail -t -i

Press Esc to exit editing, and enter: wq to save and exit.

6. Restart the php fpm process again.

/etc/init.d/php-fpm restart

At this time, the sendmail component can run normally. Go to the website and send a test email. The email will be received soon.

Like( one )
Article name: Solution to Failure to Send Mail in Contact Form 7 of the lnmp Environment
Article link: https://www.vpsss.net/2795.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.