4

我们使用 Amazon SES 发送电子邮件,它说我们的最大发送速率是每秒 5 封。

我不知道如果我们每秒发送超过 5 个会发生什么? 他们排队还是被拒绝?

我们有一个包含 1,000 多人的邮件列表,他们都尝试一次性发送所有邮件(我们已获准为此目的使用 Amazon SES)。

这是我用来发送电子邮件的代码:

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

            }
        }
    }
}
4

3 回答 3

6

我认为,如果我们尝试每秒发送更多消息然后是允许的限制,那么请求会被拒绝。

我在 SES 博客http://sesblog.amazon.com/post/TxKR75VKOYDS60/How-to-handle-a-quot-Throttling-Maximum-sending-rate-exceeded-quot-error中找到了这个

当您调用 Amazon SES 的速度超过分配的最大发送速率时,Amazon SES 将拒绝您的超出限制的请求,并显示“限制 – 超出最大发送速率”错误。

“限制 - 超出最大发送速率”错误是可重试的。此错误不同于 Amazon SES 返回的其他错误,例如从未经验证的电子邮件地址发送或发送到列入黑名单的电子邮件地址。这些错误表明当前形式的请求不会被接受。可以稍后重试因“限制”错误而被拒绝的请求,并且很可能会成功。

如果他们将请求排队,这将是一个不错的选择,但我们的经验是他们不会。如果我在这里理解错误,请告诉我。

于 2013-02-27T07:17:40.867 回答
3

从那以后,我发现答案是他们被拒绝了。

于 2012-03-28T16:11:10.080 回答
1

如果您在达到每日发送配额(您在 24 小时内可以发送的最大电子邮件数量)或最大发送速率(您每秒可以发送的最大消息数)之后尝试发送电子邮件,Amazon SES 会下降并且不会尝试重新传递它

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

我陷入了这种情况,并且正在寻找解决问题的最佳方法。

于 2019-07-30T00:22:35.423 回答