【发布时间】:2012-01-07 12:17:33
【问题描述】:
可能重复:
Swiftmailer 4 does not retrieve bounces as $failedRecipients
我正在使用SwiftMailer 使用 SMTP 通过我的 GMail 帐户发送电子邮件。
我已经完美地完成了所有设置,我可以毫无问题地发送电子邮件。
documentation 表示如果没有成功发送消息,send() 应该返回 0,并使用失败的电子邮件地址填充一个数组(我称之为 $failures)。
我看到的问题是,如果我向不存在的地址 (asdfasdf@thisdomaindoesnotexist1111.com) 发送电子邮件,我会收到来自 GMail 的回复:
Mail Delivery Subsystem mailer-daemon@googlemail.com
9:06 PM (6 minutes ago)
to me
Delivery to the following recipient failed permanently:
asdfasdf@thisdomaindoesnotexist1111.com
Technical details of permanent failure:
DNS Error: Domain name not found
----- Original message -----
但是,swiftmailer 仍然返回 1(成功发送 1 条消息)并且 $failures 数组仍然为空。
由于连接是使用 SSL 加密的,我认为我无法使用wireshark 嗅探和查看数据包。
我的预感是 GMail 的 SMTP 服务器返回成功,同时它会生成一封关于失败的电子邮件并将其发送到发送地址。
这是正确的吗?如果是这样,有什么方法可以捕获 PHP 中的故障?
【问题讨论】:
-
Swiftmailer 只发送电子邮件。错误消息稍后会出现,Swiftmailer 不会检查这些。
-
提示:您可以在实际尝试发送电子邮件之前检查该域是否存在 MX DNS 记录:php.net/manual/en/function.checkdnsrr.php
标签: php gmail swiftmailer