WordPress "Unable to send e-mail, possible reason: Your host has disabled the Mail () function" Workaround

Source: Internet
Author: User
Tags contact form

WordPress Web Site "Could not send e-mail, possible reasons: your host disabled mail () function" situation is generally because the host environment does not support the online mail messaging function, if not supported, then like Newsletter, contact Form 7 You will not be able to use plugins that require mail messaging. However, for this problem, most of the host or server can still be resolved, if the following methods are still unable to solve the mail messaging function, then you can only contact your space service provider to solve.

ways to check whether the space supports mail messaging
    1. 1. Non-login status, visit the website background login interface (default is www.youwebsite.com/wp-login.php), click the find password link below the form, as shown in:

2. Go to the Retrieve Password page, enter your user registration email or username in the username or email address form, and click the Retrieve password button as shown in:

3. If it appears, Please check the confirmation link in your email address. "Prompt to indicate that the host supports the mail messaging function.

If the " e-mail failed to send" message appears, the possible reason: Your host has disabled the mail () function. "indicates that the host does not support mail messaging.

WordPress can't send mail solution

Corresponding to the ordinary virtual host, to open the fsockopen (generally in the host provider's management background can be opened, will not contact the host customer service).

1. In the/wp-includes/directory of the site to find and open class-smtp.php is about 274-282 lines (different versions of WordPress may be different), find the following code:

$this->smtp_conn = @stream_socket_client(
$host . ":" . $port,
$errno,
$errstr,
$timeout,
STREAM_CLIENT_CONNECT,
$socket_context
);

Comment out or delete this code, and then modify it to the following code:

 $this->smtp_conn = fsockopen($host, $port, $errno, $errstr);

After the modification, if you still cannot send the message, continue to add the following code if the above steps are complete:

/**
* 修复 WordPress 邮件发送”
* 以QQ邮箱为例**/
function mail_smtp( $phpmailer ){
$phpmailer->From = "[email protected]"; //发件人
$phpmailer->FromName = "技术宅"; //发件人昵称
$phpmailer->Host = "smtp.qq.com"; //SMTP服务器地址
$phpmailer->Port = 25; //SMTP端口,常用的有25、465、587,具体谷歌百度
$phpmailer->SMTPSecure = ""; //SMTP加密方式,常用的有SSL/TLS,具体谷歌百度
$phpmailer->Username = "[email protected]"; //邮箱帐号
$phpmailer->Password = *********; //邮箱密码
$phpmailer->IsSMTP(); //使用SMTP发送
$phpmailer->SMTPAuth = true; //启用SMTPAuth服务
}
add_action(‘phpmailer_init‘,‘mail_smtp‘);

After performing the above operation, your website should be able to send and receive mail. If this is still not possible, this may be the only modification code can not be resolved, please contact the host to resolve the process.

Original: http://www.wpyou.com/wordpress-unable-to-send-e-mail-solution.html

WordPress "Unable to send e-mail, possible reason: Your host has disabled the Mail () function" Workaround

Related Article

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.