【问题标题】:IIS SMTP with SmartHost at SendGrid.NetSendGrid.Net 上带有 SmartHost 的 IIS SMTP
【发布时间】:2017-03-23 16:08:43
【问题描述】:

我用 IIS 配置了我的 Windows Server 2016 以从 php 中提取 mail() 并将它们发送到 stmp.sendgrid.net。

为了测试我的配置,我可以 telnet 我的本地主机并毫无问题地从那里发送电子邮件。

但是,如果我通过 mail() php 函数发送电子邮件,SendGrid 会收到请求,但会因以下错误而阻止它:

REASON550 5.7.1 [167.89.55.39 11] Our system has detected that this message is not RFC 5322 compliant: Multiple 'From' headers found. To reduce the amount of spam sent to Gmail, this message has been blocked. Please visit https://support.google.com/mail/?p=RfcMessageNonCompliant and review RFC 5322 specifications for more information. h190si13823586ite.62 - gsmtp 

所以错误是因为它是 IIS 将电子邮件发送到 sendgrid,因此,它被标记为垃圾邮件。

这是什么原因造成的?

【问题讨论】:

  • 似乎 IIS 不只是充当中继,而是附加了一些标头。是否可以在进入 IIS 之前和之后查看 MIME 消息?然后您可以将问题隔离到代码或服务器。

标签: windows iis server sendgrid smarthost


【解决方案1】:

显然,在使用 PHP mail() 时需要详细的标题,而不是在远程登录时。

对于 PHP mail() 的最小值:

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: your@email.com" . "\r\n";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多