0
我試過聲明主機已經已經發布類似
1網站上的所有解決方案)爲smtp.gmail.com
2)安全:虛假和rejectUnauthorized作爲未註冊
3)在Gmail允許不夠安全的應用許可
代碼片段看起來是這樣的節點的郵件錯誤:連接ECONNREFUSED
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
port:'465',
secure: 'false',
auth: {
user: 'my_id',
pass: 'my_password'
},
tls: {
rejectUnauthorized: false
}
});
var mailOptions = {
from: 'myemail',
to: receiver's email,
subject: "some text",
text: "some text"
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
,我仍然得到錯誤
{ Error: connect ECONNREFUSED 74.125.124.109:465
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
code: 'ECONNECTION',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '74.125.124.109',
port: 465,
command: 'CONN' }
想法如何解決這個問題?
我正在做一個膩子終端,使它成爲一個Linux環境,所以我想這不是問題。踢開始節點服務器試圖從我的網站上發送電子郵件的域名,這發生! – Sujay66