In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail about the WordPress email prompt "your host disabled Mail function" how to do, the editor thinks it is very practical, so share it for you to do a reference, I hope you can get something after reading this article.
Specific problem situation
Recently, when looking up the topic BUG, we found a very interesting phenomenon, that is, there is a problem with the setting of the SMTP mailbox. The comment reply can be sent abnormally, but there is no hint of audit. The following error is found through the mailbox:
Unable to send email.
Possible reason: the mail () function is disabled on your host.
Detect whether the mail function is disabled
Use the PHP probe to detect whether the host vendor has disabled the mail function.
The PHP probe code is as follows, saved as a php file, uploaded to the server and then tested:
Solution
Originally thought that Hengtian host disabled the mail () function, but through the PHP probe found that it is not disabled.
The following provides solutions for disabling and supporting mail functions where mail functions are disabled for everyone. Experience ah, no one will fall here again.
The solution of disabling mail function on host
Through the PHP probe above, if it is found that the host has disabled the mail function, it will directly use SMTP to send mail instead of the original mail function.
Send the SMTP mailbox setting code (example is blog mailbox setting) here and throw it into functions.php.
Function mail_smtp ($phpmailer) {$phpmailer- > From = "lijie@php2.cc"; / / Sender $phpmailer- > FromName = "PHP secondary development"; / / Sender nickname $phpmailer- > Host = "smtp.ym.163.com"; / / SMTP server address $phpmailer- > Port = 25; / / SMTP port, commonly used are 25,465,587, specifically Google Baidu $phpmailer- > SMTPSecure = "" / / SMTP encryption method, commonly used is SSL/TLS, specifically Google Baidu $phpmailer- > Username = "lijie@php2.cc"; / / email account $phpmailer- > Password = *; / / email password (brother-in-law replaced with an asterisk) $phpmailer- > IsSMTP (); / / use SMTP to send $phpmailer- > SMTPAuth = true; / / enable SMTPAuth service} add_action ('phpmailer_init','mail_smtp')
Host supports mail function solution
If the test supports the mail function, look down:
Since there was only the test administrator's mailbox before, I tried to register a new user and use the mailbox to retrieve the password. As a result, the email was sent normally, without surprise.
Then, I changed the SMTP mailbox account to 163mailbox, re-use the administrator mailbox to find the password, the result is also normal to receive, no surprise.
Finally, it is clear that the original receiving mailbox and sending mailbox can not be the same. This result surprised me that it appeared in such a small link that I thought it was a theme problem. I changed the code several times and was embarrassed, but also fixed a major BUG. Twists and turns ah, there is no time to toss about if you are young.
But then again, since the replacement of the 163 mailbox, the 163 mailbox has received a lot of reviews, comments, registration, email reminders, whether you are upset or not, just set up a separate administrator mailbox as a sending mailbox. This can effectively reduce the number of e-mails received, and now the ear is quiet.
About "WordPress send email prompt" your host disabled Mail function "what to do" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.