Dora
Dora

Reputation: 292

email delivery gets blocked if any one recipient email fromat is incorrect

I am facing a problem with mail delivery. My project is based on PHP application. I am using smtp to send mails . A group mail is sent from a email tool. If by any chance any one of the email address format withing the recipient group is incorrect (ex dora@yahoo) , then the email fails to get delivered.

What actually is blocking the email? Is it due to some PHP inbuilt mail function? Or does the smtp blocks it?

Please help me guys to solve this issue.

Upvotes: 0

Views: 203

Answers (2)

Dora
Dora

Reputation: 292

my problem got solved. Actually the problem was due to one invalid email address present in the group of recipients.

Upvotes: 0

Stephane Gosselin
Stephane Gosselin

Reputation: 9148

First off, your question is very vague. I assume you do not get any error message when your script executes. Here is how I would handle this:

  • First thing to do is make sure your error handling is set to display errors.

  • Reproduce the error -> run the script, if possible from the command-line with php -f scriptname.php and send it malformatted emails.

  • Either fix the script inline, or possibly better, ensure that emails that reach reach script have been validated. There are many php tools available for this.

If you just need a quick fix, php's native filter_var could be of some help.

  • Last but not least, consider keeping a 'testscript' available that reproduces the steps you did above. You do not want to go through all this every time this thing chokes, and as my hero the great rms once said, if a job is worth doing once it is worth doing a tool that does the job for you.

Good-luck!

Upvotes: 1

Related Questions