And*_*gen 6 php email sendmail
我正在尝试通过 PHP mail() 函数发送邮件,据我所知,该函数使用 sendmail 来交付货物。现在我的问题是 mail() 返回 true 但我的邮箱中甚至没有邮件的痕迹(是的,我也检查了垃圾邮件)。
所以我尝试从终端手动发送一些邮件,但问题仍然存在。sendmail 没有给我一个错误,除了无法确定域错误,我通过将我的开发机器的域添加到 /etc/hosts 并将其与 127.0.0.1 相关联来修复该错误。
andreas@Andreas-PC-Ubuntu:~$ sendmail xxxxxxx@xxxxxxx.com
Test
.
andreas@Andreas-PC-Ubuntu:~$
Run Code Online (Sandbox Code Playgroud)
除了没有给出错误之外,sendmail 还会在 /var/log/mail.log 中记录邮件已成功发送:
Apr 7 01:16:21 Andreas-PC-Ubuntu sendmail[11759]: q36NGIfD011759: from=andreas, size=5, class=0, nrcpts=1, msgid=<201204062316.q36NGIfD011759@home.hagenz.com>, relay=andreas@localhost
Apr 7 01:16:21 Andreas-PC-Ubuntu sm-mta[11760]: q36NGL1J011760: from=<andreas@home.hagenz.com>, size=299, class=0, nrcpts=1, msgid=<201204062316.q36NGIfD011759@home.hagenz.com>, proto=ESMTP, daemon=MTA-v4, relay=ip6-localhost [127.0.0.1]
Apr 7 01:16:21 Andreas-PC-Ubuntu sendmail[11759]: q36NGIfD011759: to=xxxxxxx@xxxxxxx.com, ctladdr=andreas (1000/1000), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=30005, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q36NGL1J011760 Message accepted for delivery)
Run Code Online (Sandbox Code Playgroud)
所以是的,有什么建议吗?
您确定收件人 SMTP 服务器不会丢弃(或至少将其列入灰名单)您的邮件吗?邮件服务器将未来自公认 MX 服务器的邮件视为垃圾邮件是很常见的。
sendmail 是否配置为使用 SMTP 中继/智能主机?如果没有,如果您将其配置为使用您的 ISP、雇主或其他托管提供商的服务器,会发生什么情况?
| 归档时间: |
|
| 查看次数: |
12517 次 |
| 最近记录: |