SMTP连接"/>
SMTP连接
我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误
{ Error: connect EACCES xx.xxx.xx.xx:25
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)
errno: 'EACCES',
code: 'ECONNECTION',
syscall: 'connect',
address: 'xx.xxx.xx.xx',
port: 25,
command: 'CONN' }
虽然我正在传递的配置是正确的,因为我正在另一个项目中传递相同的配置。
这两个项目可能在不同的服务器上,您能以同样的方式指导我吗。我被困了两天]
这里是配置以供参考
var transport = nodemailer.createTransport( {
debug: true,
host: "smtp.xx.xxx",
port: 25,
secure: false,
auth: {
user: 'xxxxxxxx',
pass:'xxxxxxxxx'
},
tls: {
rejectUnauthorized: false,
}
} );
transport.verify(function (error, success) {
if (error) {
console.log('====>' + error);
} else if (success) {
console.log("Server is ready to take our messages");
}
});
我正在尝试通过smtp发送邮件,但我无法这样做。它给了我连接错误{错误:在TCPConnectWrap.afterConnect上连接EACCES xx.xxx.xx.xx:25 [完成时](net.js:1117:14)...
回答如下:var transport = nodemailer.createTransport( {
debug: true,
host: "smtp.xx.xxx",
port: 25,
secure: false,
tls: {
rejectUnauthorized: false,
}
} );
transport.verify(function (error, success) {
if (error) {
console.log('====>' + error);
} else if (success) {
console.log("Server is ready to take our messages");
}
});
更多推荐
SMTP连接
发布评论