从 Wordpress 可靠地发送 SMTP 电子邮件 [英] Sending SMTP emails reliably from Wordpress

查看:69
本文介绍了从 Wordpress 可靠地发送 SMTP 电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Cloudways 上托管了一个 Wordpress 网站.我已经安装了他们的弹性电子邮件 SMTP 插件.理论上我只需要激活插件,然后服务器就会处理 STMP 中继和身份验证.这意味着我不需要 Wordpress 的 SMTP 插件.

I have a Wordpress site hosted at Cloudways. I have installed their Elastic Email SMTP add on. In theory I only need to activate the add on, and then the server will take care of STMP relay and authentication. Which means I don't need a SMTP plugin for Wordpress.

我添加了 v=spf1 的 SPF 值 a mx include:_spf.elasticemail.com ~all和的<代码>一个DKIM值k = RSA; T = S; P = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbmGbQMzYeMvxwtNQoXN0waGYaciuKx8mtMh5czguT4EZlJXuCt6V + l56mmt3t68FEX5JJ0q4ijG71BGoFRkl87uJi7LrQt1ZZmZCvrEII0YO4mp8sDLXC8g1aUAoi8TJgxq2MJqCaMyj5kAm3Fdy2tzftPCV/lbdiJqmBnWKjtwIDAQAB 到我的DNS设置,acording到弹性电子邮件自己的准则.

I have added a SPF value of v=spf1 a mx include:_spf.elasticemail.com ~all and a DKIM value of k=rsa;t=s;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbmGbQMzYeMvxwtNQoXN0waGYaciuKx8mtMh5czguT4EZlJXuCt6V+l56mmt3t68FEX5JJ0q4ijG71BGoFRkl87uJi7LrQt1ZZmZCvrEII0YO4mp8sDLXC8g1aUAoi8TJgxq2MJqCaMyj5kAm3Fdy2tzftPCV/lbdiJqmBnWKjtwIDAQAB to my DNS settings, acording to Elastic emails own guidelines.

如果在我的服务器上通过一个小的 PHP 脚本发送一些测试电子邮件:

If send some test email trough a small PHP scrip on my server:

$to = "web-XXXXXX@mail-tester.com";
$subject = "Testing";
$txt = "Hello world!";

mail($to,$subject,$txt,'From: noreply@mydomain.se ','-f noreply@mydomain.se ');

我在 www.mail-tester.com 上获得了优异的成绩,而且电子邮件也顺利到达我的两个不同收件箱.

I get excellent score at www.mail-tester.com, and the email also arrive without problems at two different inboxes of mine.

但是当我尝试从 wordpress 发送电子邮件时,通过插件检查电子邮件",我在 www.mail-tester.com 上得到了糟糕的分数......据说我没有完全通过身份验证,我得到 -3 减去分数特别是对于这一行:我们没有在您的域名 xxxxxx.cloudwaysapps.com 后面找到邮件服务器(MX 记录).

But when I try to send email from wordpress, trough the plugin "check email" I get crappy score at www.mail-tester.com... It's says I'm not fully authenticated and I get -3 minus score for this line in particular: We didn't find a mail server (MX Record) behind your domain name xxxxxx.cloudwaysapps.com.

与简单的 php 测试脚本相比,我在通过 Wordpress 发送测试电子邮件时为什么会得到如此糟糕的分数,我应该怎么做才能从 Wordpress 发出的邮件中获得可靠的分数?

How comes I get so bad score when sending test email trough Wordpress compared to a simple php test script, and what should I do to get reliable score on outgoing mail from Wordpress?

推荐答案

问题是 Wordpress 的默认行为是将 Return-Path 设置为服务器地址,在我的例子中:xxxxxx.cloudwaysapps.com 而不是 xxxx@mydomain.com.解决方案以及使电子邮件更有可能到达收件箱的原因是使用此 小插件.它将外发电子邮件的 Return-Path 标头设置为与发件人电子邮件地址相同.

The problem is that Wordpress has a default behavior of setting Return-Path to the server address, in my case: xxxxxx.cloudwaysapps.com instead of xxxx@mydomain.com. The solution and what also makes the email much more likely to reach an inbox is to modify the default behavior of Wordpress with this tiny plugin. It sets the Return-Path header of outgoing emails to equal the from email address.

这篇关于从 Wordpress 可靠地发送 SMTP 电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆