I have this problem with nodemailer, which works fine on my localhost, but when I pull it on my remote server it doesn't works, giving me CONNTIMEOUT error. Why does this happens? Pratically, nodemailer doesn't create the transporter for my message which I define in successive part of my code
const nodemailer = require('nodemailer');
const smtpPool = require('nodemailer-smtp-pool')
let transporter = nodemailer.createTransport(smtpPool({
service: "Gmail",
port: 587,
auth: {
user: 'myuser@gmail.com',
pass: 'mypass'
},
connectionTimeout: 10000,
socketTimeout: 10000
}));
transporter.verify(function(error,success) {
if(error) {
res.send(error);
} else {
res.send("Server is ready to take our messages");
}
})
Try doing-
Check for all this and it should work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.