问题描述
我需要与我的组织一起发送批量电子邮件.我是Java Mail API,并使用以下配置发送邮件.
I have a requirement to send bulk emails with in my organization. I am Java Mail API and sending the mails with below config.
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
邮件#1发件人:[email protected]到:[email protected]
Mail#1From: [email protected]: [email protected]
邮件#2发件人:[email protected]到:[email protected]
Mail#2From: [email protected]: [email protected]
...
邮件是循环触发的.
问题:前80封电子邮件已成功发送.从第81封邮件中,我失败了,出现了10-15封邮件的错误,以后又成功发送了几封邮件.
Problem:First 80 emails sent successfully. From 81st mail I am failing with below error for 10-15 emails and later few mails are sent successfully.
743封电子邮件中有400封失败& 343是成功的.
Out of 743 emails 400 Failed & 343 are success.
INFO | jvm 1 | 2017/08/18 07:25:54 | com.sun.mail.smtp.SMTPSendFailedException: 421 4.7.0 Try again later, closing connection. (MAIL) xsdsfasdsa.96 - gsmtp
INFO | jvm 1 | 2017/08/18 07:25:54 |
INFO | jvm 1 | 2017/08/18 07:25:54 | at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2108)
INFO | jvm 1 | 2017/08/18 07:25:54 | at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1609)
INFO | jvm 1 | 2017/08/18 07:25:54 | at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1117)
- 请帮助我解决该问题.
- smtp.gmail.com上是否有特定的每分钟限制?
谢谢,林蛙
Thanks,Rana
推荐答案
是的,我认为通过Gmail发送SMPT邮件每分钟有一定的限制(根据我的经验,该限制大约为80,80 -).但这不是100%的硬性限制,而是Gmail认为应有的硬性限制.
Yes, I think there is a per minute limit for sending SMPT messages via Gmail (around 80 in my experience that of others around 80-100). But it's not a 100% hard limit but some sort of soft limit that is enforced when Gmail thinks its due.
首先,在G Suite管理区域中检查您的消息队列.如果队列很大且仍在增长,则发送速度太快.
First, check your message queue in G Suite admin area. If the queue is huge and still growing you send too fast.
一些有用的链接:
- G Suite SMTP错误参考
- Gmail 帐户的带宽限制
- G Suite中的Gmail发送限制
- 批量发件人指南
- G Suite SMTP Error Reference
- Gmail Bandwidth limits for accounts
- Gmail sending limits in G Suite
- Bulk Senders Guidelines
没有进一步的解释,当您遭受错误的困扰时
There is no further explanation what's wrong when you suffer from the error
一般建议:
- 您可以使用池化SMTP,例如 https://nodemailer.com/smtp/pooled/
- 发送速度不要太快
- 一次发送不超过50封电子邮件
- 不要假设Gmail是本地系统.这是一项外部服务,它使用复杂的方法来使电子邮件在全球范围内可用,从而扩展了一项已有42年历史的发明,远非完美.
- 不要尝试愚蠢的事情,否则Gmail会惩罚您.
- do not send too fast
- do not send more than 50 emails at once
- do not assume Gmail is a local system. It's an external service that uses sophisticated methods to make email globally available extending a 42-year-old invention that is far from perfect.
- do not try stupid things or Gmail will punish you.
道德:如果发送大量电子邮件,最好使用自己的电子邮件服务器.
Moral: If sending a large amount of email, it's probably best to use your own email server.
这篇关于批量电子邮件失败,显示421 4.7.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!