NodeMailer: getaddrinfo Error

We are looking for some understanding of the error that I am getting.

on the .sendmail transport (func (err, info) {}), the err variable returns this:

{ [Error: getaddrinfo ENOTFOUND smtp.gmail.com] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'smtp.gmail.com' } 

I do not see any error documentation for nodemailer on my website or github, and I did not find anything useful in a google search. The closest I see this SO message . I try to send about 50 letters once a week through cron's work.

I tried this with and without the nodemailer-smtp-pool package, and my transporter currently looks like this:

 var transporter = nodemailer.createTransport(smtpPool({ service: 'gmail', auth: { user: ' xxx@gmail.com ', pass: 'xxx' }, maxConnections: 5, maxMessages: 200 })); 

I do not use XOATH yet because I have no impression what I need. I deleted DisplayUnlockCaptcha for the gmail account I use, but I don't think this is related. For what it's worth, I'm using the MEAN stack for this application.

It seems that "smtp.gmail.com" was not found when nodemailer makes a call to getaddrinfo, but I cannot understand why.

Any insight appreciated

edit:

from the nodemailer developer:

ENOTFOUND means the application was unable to resolve DNS A record for smtp.gmail.com. There may be something wrong with your DNS server. This is handled by Node, not Nodemailer, there is nothing Nodemailer can do if the host name is not resolved. If this happens randomly, then you can change your application to try again in a moment.

and it doesn't look like nodemailer supports proxies or ever plans. Looks like a dead end to me.

+5
source share
1 answer

I had the same error with my nodemailer installation and I fixed it by changing the gmail password so as not to include any special characters.

+1
source

Source: https://habr.com/ru/post/1216196/


All Articles