Solution to failed email sending in contact form 7

Source: Internet
Author: User
Tags contact form

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

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.