Wordpress 通知电子邮件将成为垃圾邮件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8497048/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Wordpress notification emails going to spam
提问by luchomolina
How can I prevent Worpress notification e-mails from going to recipients' spam folders?
如何防止 Worpress 通知电子邮件进入收件人的垃圾邮件文件夹?
I have set up a site along with its blog in three different environments as follows (I'm using "mydomain.com" instead of the actual site's domain for confidentiality reasons).
我在以下三种不同的环境中建立了一个站点及其博客(出于保密原因,我使用“mydomain.com”而不是实际站点的域)。
local.mydomain.com
andblog.local.mydomain.com
on my machinedev.mydomain.com
andblog.dev.mydomain.com
on my dev servermydomain.com
andblog.mydomain.com
on production server
local.mydomain.com
和blog.local.mydomain.com
我的机器上dev.mydomain.com
和blog.dev.mydomain.com
我的开发服务器上mydomain.com
并blog.mydomain.com
在生产服务器上
When I create users in 1 and 2 (local and dev), notification e-mails go to the inboxes of the newly created users. But when I do the same in production, they go straight to the spam folders.
当我在 1 和 2(本地和开发)中创建用户时,通知电子邮件会发送到新创建用户的收件箱。但是当我在生产中做同样的事情时,它们会直接进入垃圾邮件文件夹。
Now, by default Wordpress notifications are sent from [email protected]
, so in my case, these were sent by [email protected]
, [email protected]
and [email protected]
. So I installed the Mail From Pluginto change the default address, and now all three servers are sending the messages from [email protected]
, which is an existing and working address.
现在,默认情况下 Wordpress 通知是从 发送的[email protected]
,所以在我的情况下,这些是由[email protected]
、[email protected]
和发送的[email protected]
。所以我安装了Mail From Plugin来更改默认地址,现在所有三台服务器都从 发送邮件[email protected]
,这是一个现有的工作地址。
mydomain.com e-mails are managed by Google Accounts, that's working fine, ie, messages sent from @mydomain.com accounts are received as not-spam messages. That's including that [email protected]
address.
mydomain.com 电子邮件由 Google 帐户管理,运行良好,即从@mydomain.com 帐户发送的邮件将作为非垃圾邮件接收。这包括那个[email protected]
地址。
All this leaves me thinking there might be something wrong with the server that's hosting my production site, but I have no idea where to start looking.
所有这些让我觉得托管我的生产站点的服务器可能有问题,但我不知道从哪里开始寻找。
Thoughts?
想法?
回答by Lednine
I usually handle this on the server level by ensuring all emails sent by wordpress are sent via my own SMTP server. You can do this a couple ways. My preference is to configure all mail being sent from my server to use SMTP. I usually use an Ubuntu server - here is a link to using PostFix SMTP https://help.ubuntu.com/community/Postfix. Another way would be to use one of the SMTP plugins and configure to use your email server.I have used this one in the past - http://wordpress.org/extend/plugins/wp-mail-smtp/screenshots/.
我通常通过确保 wordpress 发送的所有电子邮件都通过我自己的 SMTP 服务器发送来在服务器级别处理此问题。你可以通过几种方式做到这一点。我的偏好是将从我的服务器发送的所有邮件配置为使用 SMTP。我通常使用 Ubuntu 服务器 - 这是使用 PostFix SMTP https://help.ubuntu.com/community/Postfix的链接。另一种方法是使用 SMTP 插件之一并配置为使用您的电子邮件服务器。我过去曾使用过这个插件 - http://wordpress.org/extend/plugins/wp-mail-smtp/screenshots/。
回答by ajeet
Its work definitely
它的工作绝对
Please use this code its help you:-
请使用此代码,它可以帮助您:-
add_filter( 'wp_mail_from', 'my_mail_from' );
function my_mail_from( $email ) {
return "enter yout 'from' id";
}
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from_name($old) {
return 'enter your "from name"';
}
wp_mail( $admin_mail, $subject, $message );