I've configured Amazon SES and obtained the first level of increased sending rate. So my limits are now 10,000 emails/day, 5 emails/second. My question is: do I need to enforce those rates within my own application (i.e. ensure no more than 5 emails are sent to the SMTP server per second) or can I rely on the server queuing any mail beyond the rate and sending it with a delay?
Of course, I recognise the need to still average out to those rates, but I have a function in my app that sends out ~ 1,500 emails in a 'batch', and I just need to know if I need to throttle it, or if I can just let it run through as quickly at it can.
If you exceed your quota - either your daily quota or your sending rate, you will receive an error message, and the message will not be sent. It will not be queued on the SES side. If a message is accepted by SES it will be sent by them in a fairly short time frame.
This means that you need to build in a bit of delay if your application is sending too fast, and should check your quotas as you send. Alternatively, just wait until you get an error, and then, depending on the error, pause an appropriate amount of time.
The error message will be of the 400 variety, typically 'Maximum sending rate exceeded'. You should reduce the concurrent threads launched by your mailer to accommodate for this. If you are using the ses-send-email.pl script, you can modify it to return a temporary failure when SES sends a 400 error.
External links referenced by this document: