Search code examples
node.jsgmail-apinodemailersmtp-auth

Gmail - smtp error 421 4.7.0


We are using gmail oAuth2 to send the mail from nodemailer and receiving below error -

{"code":"EENVELOPE","response":"421 4.7.0 Temporary System Problem.  
Try again later (WS). e189-v6sm98ioe.0 - 
gsmtp","responseCode":421,"command":"DATA"}

Out testing team by mistake run the automation test script and triggered a lot of mails simultaneously, I understand that might have blocked the mail's temporarily as the error suggest. I am interested to know how long this blockage will continue and what can one do to resolve it. At this point it is not possible for us to switch mail sending from gmail to some thing else.


Solution

  • I faced the same problem as I tried to pump several mails as part of load testing, nearly 100 mails in a minute. After sending 500 mails, Gmail started rejecting the connection with the same error.

    The situation became normal after I introduced a think time of 1 second, limiting the outgoing mail at < 50 per min.

    For me, Gmail was rejecting my mails only for a duration of 3 minutes.