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.
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();
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.
The Issue resolved with the TCP port changing to 587 from 25 in Outbound Connections settings in SMTP Server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With