swiftmailer 电子邮件未到达
您好,我正在尝试使用 swiftmailer 版本 4.0.3 发送电子邮件。 我收到返回码 2。消息似乎已发送,但没有到达。
我正在使用 sendmail 传输模式,
$this->psTransport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t');
我得到的返回码为 2,并且没有发生异常。
有人熟悉这个问题吗?
Hello I am trying to send email messages with swiftmailer version 4.0.3.
I get a returncode 2. And it seems the messages are sent, however they don't arrive.
I am using the sendmail transport mode
$this->psTransport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t');
I get a return code of 2 and no exception happens.
Anyone familiar with this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SMTP 传输 Swift_SmtpTransport 无疑是最常用的传输,因为它可以在 99% 的 Web 服务器上运行。
这是一种更专业的方式来做你想做的事。 请参阅文档:
http://swiftmailer.org/docs/smtp-transport
SMTP 传输是简单,并且您的消息更容易被接收者识别,因为发送电子邮件的不是您的网络服务器,而是已经稳定的电子邮件服务器,具有已知且经过批准的 IP。
The SMTP Transport, Swift_SmtpTransport is without doubt the most commonly used Transport because it will work on 99% of web servers.
It is a more profissional way to do what you want. See the docs:
http://swiftmailer.org/docs/smtp-transport
SMTP Transport is simple and your messages are better recognized by the receivers because it's not your webserver sending your emails, but an email server already stabilished, with a known and approved ip.
使用 PHP 套接字发送邮件大多数时候会受到远程 SMTP 服务器的处罚并被检测为垃圾邮件。 我已经多次遇到同样的问题了。
我的建议是改用 SMTP 传输方法,并通过经过认可和验证的 SMTP 发件人服务器发送消息。 如果您每小时发送的消息不多,您甚至可以使用 GMail 服务器,我经常使用它们进行测试和小型应用程序。
Using PHP sockets to send mail is most of the times penalized by remote SMTP servers and detected as spam. I've suffered the same issue several times.
My advise is to use a SMTP transport method instead and send your messages through a recognized and validated SMTP sender server. If you are not sending too much messages per hour you can even use GMail servers, I use them very often for tests and small applications.