简体   繁体   中英

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

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.

When I send an email to the domain my.customer@gmai.com or my.customer@gmailzzz.com I will get a SMTP 550 error. But when I send an email to my.customer@gmail.dk I will not get a response at all.

I have tried to look if the domain gmail.dk is taken at www.dk-hostmaster.dk but it seems not to be. So why do I not get an error in return when sending an email to gmail.dk ???

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. Are you using sendmail?

SMTP is a protocol that inherently expects that delivery could take a while. 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). 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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