Reputation: 21
ZF2 throws uncaught exception when i am trying to send multiple mail at the same time, using SMTP server.
After sending 5 emails it throws an exception:
Uncaught exception: "Could not read from host" from Zend\Mail\Protocol\AbstractProtocol
this comes after SMTP server sends an error:
Message submission rate for this client has exceeded the configured limit
since this is thrown when destructor is called i am not able to catch it in my script. Any suggestion how to catch this, in my script.
Upvotes: 0
Views: 220
Reputation: 10099
There is nothing to do with Zend Framework 2 or any other library. The message from the mail service which you consuming is pretty clear: you're exceeding the rate limit.
Anyway, you have several options;
try {} catch() {}
block in your script and when you exceed the limit, just stop, wait for a while and try again.Upvotes: 1