454 Throttling failure: Maximum sending rate exceeded.

samba 发布于 2012/11/27 11:48
阅读 206
收藏 0

com.sun.mail.smtp.SMTPSendFailedException: 454 Throttling failure: Maximum sending rate exceeded.

        at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)

        at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1215)

        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:586)

        at com.amazon.ses.SendMessageRunnable.startSendEmail(SendMessageRunnable.java:122)

        at com.amazon.ses.SendMessageRunnable.run(SendMessageRunnable.java:58)

        at java.lang.Thread.run(Thread.java:722)

代码如下:我在发送email 的时候加入了多线程。可能是500封,也可能是1000封。或2000 - 4000.

transport = session.getTransport("smtp");

transport.connect("email-smtp.us-east-1.amazonaws.com", UserInformation.emailUser, UserInformation.emailPassword);

for (SObject contact : result.getContacts()) {

if (contact.getField("Email") != null) {

if (!transport.isConnected()) {

transport.connect("email-smtp.us-east-1.amazonaws.com", UserInformation.emailUser, UserInformation.emailPassword);

}

Thread thread = new Thread(new SendMessageRunnable(tasks,

transport, sender, emailTemplate,

contact, attachments, documents));

flag = true;

thread.start();

listThread.add(thread);

}

}

大家帮忙看下。

加载中
0
红薯
红薯
服务器限制了你的发送频率,发太狠了
0
samba
samba
如果我在下一个线程启动之前 sleep(1000); 这样这个问题能解决吗?
返回顶部
顶部