简体   繁体   English

PHP 5邮件 - 发送邮件时没有错误

[英]PHP 5 mail - no error when sending mail

I have (maybe) an odd experience with a Danish email domain. 我(或许)有一个丹麦电子邮件域的奇怪经历。 It all starts with that I want to test my code so it could handle errors. 这一切都始于我想测试我的代码,以便它可以处理错误。

I have a homepage with a form where my customers can submit their emails. 我有一个主页,其中包含我的客户可以提交电子邮件的表单。 Sometimes my customers sends me mails with an email address like my.customer@gmail.dk SIGH 有时我的客户会给我发邮件,邮件地址如my.customer@gmail.dk SIGH

In PHP mail(), I use the additional parameters "-f bounce@my.domain.dk" such that I should get an error if the mail could not be delivered. 在PHP mail()中,我使用了附加参数“-f bounce@my.domain.dk”,这样如果无法传递邮件,我就会收到错误。

When I send an email to the domain my.customer@gmai.com or my.customer@gmailzzz.com I will get a SMTP 550 error. 当我向域my.customer@gmai.com或my.customer@gmailzzz.com发送电子邮件时,我将收到SMTP 550错误。 But when I send an email to my.customer@gmail.dk I will not get a response at all. 但是当我发送电子邮件到my.customer@gmail.dk时,我根本得不到答复。

I have tried to look if the domain gmail.dk is taken at www.dk-hostmaster.dk but it seems not to be. 我试图查看域名gmail.dk是否在www.dk-hostmaster.dk上获取,但似乎不是。 So why do I not get an error in return when sending an email to gmail.dk ??? 那么为什么我在向gmail.dk发送电子邮件时没有收到错误?

https://www.dk-hostmaster.dk/index.php?id=42&query=gmail.dk&submit=S%F8g https://www.dk-hostmaster.dk/index.php?id=42&query=gmail.dk&submit=S%F8g

It is owned already by Google inc. 它由谷歌公司拥有。 They may have a catch-all set up, or more likely, no bounces returning at all? 他们可能有一个全能的设置,或者更可能的是,根本没有返回弹跳?

Where do you actually get these error messages? 你在哪里真正得到这些错误消息? The additional parameters you pass to mail() just get passed on to the mail server you are using, and so the results will depend on what server you're using to send email. 传递给mail()的其他参数只会传递给您正在使用的邮件服务器,因此结果将取决于您用于发送电子邮件的服务器。 Are you using sendmail? 你在使用sendmail吗?

SMTP is a protocol that inherently expects that delivery could take a while. SMTP是一种本身期望交付可能需要一段时间的协议。 Some mail servers even arbitrarily reject the first attempt to send a mail, forcing the sender to retry again later, just to discourage lazy spammers. 有些邮件服务器甚至任意拒绝第一次发送邮件的尝试,迫使发件人稍后再次尝试,只是为了阻止懒惰的垃圾邮件发送者。

It may be the case that when your mail server can't connect to "gmail.dk," it assume there is only a transient connection problem and intends to try again in a few hours (or even in a few days). 可能的情况是,当您的邮件服务器无法连接到“gmail.dk”时,它会假设只有一个短暂的连接问题,并打算在几个小时(甚至几天)内再次尝试。 It could be that some of the other addresses you tried to send to replied with a more specific error (like, "that user doesn't exist in our system"), allowing your server to know the delivery failure is a permanent one. 可能是您尝试发送的其他一些地址回复了更具体的错误(例如,“用户在我们的系统中不存在”),允许您的服务器知道传递失败是永久性的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM