Recently, two friends have encountered the same problem. After deploying the LNMP environment on the newly purchased Linux VPS, they installed a WordPress. The sender of the article comments and replies was: WordPress, and the sender’s address was [email protected]domain name format. Regarding how to solve this problem, change the default sender and sender address to the name and address you specified. I have encountered it before with a good VPS, and found relevant solutions on the Internet. I thought of recording it here.
First, make sure that our LNMP can send and receive emails normally (you can detect emails under the probe), and that the WordPress background has set up email notifications for comments and replies.
In fact, the solution is very simple. We need to add 2 functions to functions.php in the WordPress theme file, as shown below:
wordpress-email
Insert the following code at the appropriate location in the file:

// Change the default sending address
add_filter("wp_mail_from","mail_from");
function mail_from() {
$emailaddress = "[email protected]"; //Your email address
return $emailaddress;
}
// Change the default sender name
add_filter("wp_mail_from_name","mail_from_name");
function mail_from_name() {
$sendername = "ZhaoRong"; //Your name
return $sendername;
}

Once completed, save it and try again to view the sender information of the email. It has been corrected. This method is also applicable to the same problem encountered by PHP virtual host (windows requires plug-in support).
If you encounter similar problems in other source codes, you can also try to modify the hostname or forcefully specify the email address in sendmail_path in php.ini.

Tags: Wordpress, WordPress modify sender, WordPress sender

window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["mshare","kaixin001","tsina"," tsohu","tqq","renren","qzone","weixin","bdysc","bdxc","tqf","tieba","douban","bdhome","sqq","thx" ],"bdPic":"","bdStyle":"0","bdSize":"24"},"slide":{"type":"slide","bdImg":"2","bdPos" :"left","bdTop":"100"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["tsina","tqq","tsohu","qzone","renren", "weixin","mshare"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg .share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
postid
12508

Leave a Reply