[英]email verification nodemailer works on localhost but not on server
[英]Nodemailer works on my localhost but not on my remote server
我的 nodemailer 有这个问题,它在我的本地主机上工作正常,但是当我将它拉到我的远程服务器上时它不起作用,给我 CONNTIMEOUT 错误。 为什么会这样? 实际上,nodemailer 不会为我在代码的连续部分中定义的消息创建传输器
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");
}
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.