【问题标题】:Amazon SES Max Send RateAmazon SES 最大发送速率
【发布时间】:2019-07-30 08:22:35
【问题描述】:

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

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

我们有一个包含 1000 多人的邮件列表,他们都试图一次性发送所有邮件(我们已获准为此目的使用 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)
            {

            }
        }
    }
}

【问题讨论】:

    标签: email queue amazon amazon-ses


    【解决方案1】:

    我认为如果我们尝试每秒发送的消息超过允许的限制,请求会被拒绝

    我在 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 返回的其他错误,例如从未经验证的电子邮件地址发送或发送到列入黑名单的电子邮件地址。 这些错误表明当前形式的请求不会被接受。因“限制”错误而被拒绝的请求可以稍后重试,并且很可能会成功。

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

    【讨论】:

      【解决方案2】:

      我后来发现答案是他们被拒绝了。

      【讨论】:

      【解决方案3】:

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

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-22
        相关资源
        最近更新 更多