0
votes

Our Application will send an Automation mail while sending failed with Error code "SMTP Send Failed Exception: 421: Error: too many messages in one session"

This Problem gets resolved automatically after few minutes. Hourly 40-50 Mails sent to different Users. But on Everyday this problem arises and failed to send mail and got resolved automatically after few minutes.

This problem is not particular to a specific user.

Below are the logs com.sun.mail.smtp.SMTPSendFailedException: 421 Error: too many messages in one session

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057) ~[mail-1.4.4.jar!/:1.4.4]
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1580) ~[mail-1.4.4.jar!/:1.4.4]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1097) ~[mail-1.4.4.jar!/:1.4.4]
at com.abc.tools.mail.EMailer$MailTask.call(EMailer.java:213) [classes:na]
at com.abc.tools.mail.EMailer$MailTask.call(EMailer.java:128) [classes:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_60]

Could you please let me know what could be the reason.

1
Are you sending emails multi-threaded? Have you try reduce the batch size? - Minh Kieu
Yes sending the emails in multithreaded but not batch. Through Application the mail will be triggered and on average 40-50 mail per hour.. - Surenthiran T
Maybe post the sending email code? 40-50 email per hour doesn't sound like much. - Minh Kieu
I got the Answer: Error Code : 421 - Temporary Connection Failure as the messages size exceeds the Default limit (20) of an session. Refer the Links below, docs.mailpoet.com/article/… msexchangeguru.com/2011/08/18/errors emailarchitect.net/emailserver/doc/html/smtpd.htm microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/… Now I need to know how the message count is calculated? Please suggest if anyone idea about it? - Surenthiran T
Nice - Post your answer to complete your question. - Minh Kieu

1 Answers

0
votes

Error Code 421: Too Many messages in a session. Root Cause: Few limitation was available at IIS, One of the limitation is

Limit Message size