1. Why contact form 7 cannot send emails
The mail () function is not supported.
Contact Form 7 form submission failedIn the process of use, the cause is that the WordPress host is faulty. Because many hosts in the country are not dedicated to WordPress, the so-called all-around win + IIS + PHP is used, in this environment, the mail () function of WordPress is rarely supported. The reason for the failure in submitting the contact form 7 form is as follows. This also raises the issue of WP mail SMTP settings.
Ii. Solution
There are two points to solve this problem.
1. Download a plug-in WP-mail-SMTP to provide support
2. Modify WP-content \ plugins \ contact-form-7 \ includes \ mail. php (if this cannot be solved in 1, you need 2)
Procedure:
1) download the WP-mail-SMTP plug-in
2) set the SMTP plug-in
Below is the 163 mailbox
Note:The username here is the complete address of your mailbox, for example, [email protected]
The password here is your email password.
3) Test the email reply function
Set the last item in WP-mail-SMTP,Write the email address you want to send for test.
If you click send, the following message is displayed, indicating that the SMTP plug-in is successfully started.
Test message sent
The result was:
Bool (false
........................
........................
Next, open the target email address and you will immediately see the email. This means your plug-in is successfully enabled. You can use this mailbox to implement many WordPress mail functions.
PS:If you fail to receive an email during the test, the following code appears at the bottom of the Code after you click send:
Test message sent
The result was:
Bool (false
........................
........................
SMTP-> error: failed to connect to server:
So we need to solve 2,
Open: Wp-content \ plugins \ contact-form-7 \ des \ mail. php
Search: $ headers = "from: $ sender \ n ";
Changed to: $ headers = "from $ sender \ n ";
This can be solved.
[An SMTP plug-in + modify the mail. php file of the plugin plug-in]
Solution to failed email sending in contact form 7