I tried to send email using gmail-send package in the node.js back-end.
var send = require('gmail-send')({
user: '*@gmail.com',
pass: '*',
subject: '*',
to: '*@gmail.com'
})
send({
html: stringTemplate
}, function(err, res, full){
if (err) {
console.log(err);
}
})
This is my code but I got this error.
{ Error: Connection timeout
at SMTPConnection._formatError (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:771:19)
at SMTPConnection._onError (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:757:20)
at Timeout._connectionTimeout.setTimeout (E:\project\node_modules\nodemailer\lib\smtp-connection\index.js:229:22)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10) code: 'ETIMEDOUT', command: 'CONN' }
I'm struggling with this problem for a long time but I can't find solution. Before I used nodemailer, but I also get the same error. Please help me. Thank you for careful watching.