Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon SES Max Send Rate

We're using Amazon SES to send emails, and it says our max send rate is 5 per second.

What I can't find out is what happens if we send more than 5 per second? Do they queue or are they rejected?

We have a mailing list that has over 1,000 people on it and they all attempt to send all in one go (and we are approved to use Amazon SES for this purpose).

Here's the code I'm using to send the email:

namespace Amazon
{
    public class Emailer
    {
        /// <summary>
        /// Send an email using the Amazon SES service
        /// </summary>
        public static void SendEmail(String from, String To, String Subject, String HTML = null, String emailReplyTo = null, String returnPath = null)
        {
            try
            {
                List<String> to
                    = To
                    .Replace(", ", ",")
                    .Split(',')
                    .ToList();

                var destination = new Destination();
                destination.WithToAddresses(to);

                var subject = new Content();
                subject.WithCharset("UTF-8");
                subject.WithData(Subject);

                var html = new Content();
                html.WithCharset("UTF-8");
                html.WithData(HTML);

                var body = new Body();
                body.WithHtml(html);

                var message = new Message();
                message.WithBody(body);
                message.WithSubject(subject);

                var ses = AWSClientFactory.CreateAmazonSimpleEmailServiceClient("xxx", "xxx");

                var request = new SendEmailRequest();
                request.WithDestination(destination);
                request.WithMessage(message);
                request.WithSource(from);

                if (emailReplyTo != null)
                {
                    List<String> replyto
                        = emailReplyTo
                        .Replace(", ", ",")
                        .Split(',')
                        .ToList();

                    request.WithReplyToAddresses(replyto);
                }

                if (returnPath != null)
                    request.WithReturnPath(returnPath);

                SendEmailResponse response = ses.SendEmail(request);

                SendEmailResult result = response.SendEmailResult;
            }
            catch (Exception e)
            {

            }
        }
    }
}
like image 492
Tom Gullen Avatar asked Dec 27 '22 04:12

Tom Gullen


2 Answers

I think that the request are rejected if we are trying to send more messages per second then the allowed limit.

I found this in the SES Blog http://sesblog.amazon.com/post/TxKR75VKOYDS60/How-to-handle-a-quot-Throttling-Maximum-sending-rate-exceeded-quot-error

When you call Amazon SES faster than your maximum allocated send rate, Amazon SES will reject your over the limit requests with a "Throttling – Maximum sending rate exceeded" error.

A "Throttling – Maximum sending rate exceeded" error is retriable. This error is different than other errors returned by Amazon SES, such as sending from an email address that is not verified or sending to an email address that is blacklisted. Those errors indicate that the request will not be accepted in its current form. A request rejected with a "Throttling" error can be retried at a later time and is likely to succeed.

If they would queue the requests this would be a great option but our experience is that they don't. Please let me know if I understand something wrong here.

like image 108
Victor Smirnov Avatar answered Feb 07 '23 10:02

Victor Smirnov


I've since found out the answer is that they are rejected.

like image 43
Tom Gullen Avatar answered Feb 07 '23 10:02

Tom Gullen