質問

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)
            {

            }
        }
    }
}
役に立ちましたか?

解決 2

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

他のヒント

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.

If you attempt to send an email after reaching your daily sending quota (the maximum amount of email you can send in a 24-hour period) or your maximum sending rate (the maximum number of messages you can send per second), Amazon SES drops the message and doesn't attempt to redeliver it.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/reach-sending-limits.html

I'm getting stuck on this situation and on the way finding the best way for resoling.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top