Issue
I have some PHP code that help send emails. The way it works is that there is a list of unique keys, every key has to be sent to a different email address. Sometimes we need to be able to send 1000 of these key out at once, and hence, 1000 emails.
I am using the Pear Mail SMTP code found in this post with gmail. It works very well when sending just a small number of keys. However when I try to send many keys (over 100), i often get this error:
From what I have read, this means that for whatever reason, the SMTP server isn't taking emails right now, and denies the transfer, suggesting to try back later. I am not quite sure what to do here to handle this problem. Should I make the script pause for a few seconds and try again? Does the error mean something different? What am I to do?
Solution
Send out the keys in batches of 50, with a small time-interval between each batch. The error means that you are trying to open too many SMTP connections at the same time.
Answered By - pyrometer Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.