Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMTP Error: 454 4.7.0 Too many login attempts, please try again later

I have set up SMTP server with gmail account. It was working fine till few days back. When I checked the logs I found below entry in it:

SMTP Error: 454 4.7.0 Too many login attempts, please try again later.

I have restarted SMTP service twice. I have checked the configuration that was set up using this link. Everything is same as we have set up. I have restarted the SMTP server & the machine too.

I have checked for 2 step verification settings. It is not enabled. I have checked for "less secure" apps settings and it is set to Enabled as suggested here.

I have checked apps enabled as suggested here using below link.

https://security.google.com/settings/security/permissions?pli=1

But no apps are added. Can anyone suggest anything that I need to look for? Thanks in advance.

like image 847
love thakker Avatar asked Nov 11 '16 14:11

love thakker


Video Answer


3 Answers

It is because you are attempting to create a new smtp connection for each email. You need to use SMTP pool.

Please see:

DELIVERING BULK MAIL

POOLED SMTP

Pooled smtp is mostly useful when you have a large number of messages that you want to send in batches or your provider allows you to only use a small amount of parallel connections.

If you are using Node-mailer:

const transporter = nodemailer.createTransport({
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    pool: true, // This is the field you need to add
    auth: {
       user: '[email protected]',
       pass: 'your_password' 
}});

Then, you need to close the pool once you send all the emails.

transporter.close();
like image 162
Johnson Avatar answered Oct 12 '22 05:10

Johnson


I had the same issue. When I checked the Mail queue there were many unprocessed mails in the queue. So I deleted the bulk mails and restarted the instance. Once the Mail Queue is cleared then it started to send mails as usual.

Hope this will be useful for anybody to have the above issue.

like image 41
kds Avatar answered Oct 12 '22 05:10

kds


The Issue resolved with the TCP port changing to 587 from 25 in Outbound Connections settings in SMTP Server.

like image 1
love thakker Avatar answered Oct 12 '22 06:10

love thakker