'Gmail SMTP error - Temporary block?

I am using Gmail servers to send email from my system, with a program. Recently I started getting errors like this:

Data command failed: 421 4.7.0 Temporary System Problem. Try again later (WS). 6sm3756432pab.11 - gsmtp

The reasons are given in the support.

Can anybody tell me what is the number of emails that can trigger this issue?

Or is it because of some other reasons?



Solution 1:[1]

This error occurs if you are using scripts to send emails in quick successions. An easy way out is to apply a sleep timer in between sending emails.

I applied a timer for 1 second between each successive email.

import time
time.sleep(1) // equivalent to 1 second sleep

Solution 2:[2]

I agree with Anubhav Shrimali that the error occurs if Gmail gets multiple requests simultaneously. I had solved the problem using Nodemailer in Node.js by adding the 1 second delay between each successive email as follows:

array.foreach(function(data, index) {
    setTimeout(() => {
        sendmail();            
    }, 1000 * index);

    function sendmail() {
        transporter.sendMail(mailOptions, function (error, info) {
            if (error) {
                console.log(error);
            } else {
                console.log('Email sent' + info.response);
            }
        });
    }
});

Solution 3:[3]

I too had the same issue when I tried to send bulk emails using the multi threaded program in Java. Then I heard about Thread Pool Executor. I used it by setting Thread Pool size as 10. After that, this issue has been solved for me.

Solution 4:[4]

If this situation is encountered, it should be placed in the retry queue, and the monitoring will be notified if multiple retries fail.

Hope this link can help you?

https://support.google.com/a/answer/3726730

Solution 5:[5]

This is probably a result of bulk email sending from the same IP address. As mentioned, use the python sleep function so that there is a bit of a wait between sendings. I find that 1 second is not usually enough time for me, and I sometimes go with a random number of seconds between 1 and 5 for the most optimal results.

import random
import time
time.sleep(random.randint(1, 5))

Don't forget to import the correct modules.

Solution 6:[6]

have a rest for 20 minutes , and try again, the error gone

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anubhav Shrimal
Solution 2 Prashant Jadav
Solution 3 Barani Dharan
Solution 4 Kenshin
Solution 5 dcinderdiu
Solution 6 relaxslow