gpt4 book ai didi

php - 发送邮件问题 : successfully sent but never arrives

转载 作者:可可西里 更新时间:2023-10-31 22:57:42 24 4
gpt4 key购买 nike

我正在尝试通过 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:~$

除了不报错外,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)

是的,有什么建议吗?

最佳答案

您确定收件人 SMTP 服务器没有丢弃(或至少将其列入灰名单)您的邮件吗?邮件服务器将不是来自公认的 MX 服务器的邮件视为垃圾邮件是很常见的。

sendmail 是否配置为使用 SMTP 中继/智能主机?如果不是,如果您将其配置为使用您的 ISP、雇主或其他托管服务提供商的服务器,会发生什么情况?

关于php - 发送邮件问题 : successfully sent but never arrives,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10050357/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com