我通過nodemailer發送電子郵件它進入gmail的收件箱,如果我從本地服務器運行,但進入Gmail的垃圾郵件,如果我從微軟Azure服務器運行腳本。 下面是我的腳本通過nodemailer發送電子郵件進入垃圾郵件gmail
var nodemailer = require('nodemailer');
var EmailTemplates = require('swig-email-templates');
var smtpConfig = {
service: 'smtp.office365.com',
host: 'smtp.office365.com',
port: 587,
starttls: {
enable: true
},
secureConnection: true,
auth: {
user: '[email protected]',
pass: 'zzzzzz'
}
}
var templates = new EmailTemplates();
var transporter = nodemailer.createTransport(smtpConfig);
var context = {
username:'Rajesh',
email:'[email protected]',
link : 'www.google.co.in'
};
templates.render('activate_email.html', context, function(err, html,text, subject) {
transporter.sendMail({
from: '"Product Name" <[email protected]>', // sender address
to: '[email protected]',
subject: 'Account activation',
html: html,
text:text
});
});
我刪除,但仍然存在問題。但如果我從電子郵件中刪除鏈接,那麼它的工作。所以什麼可能是解決方案鏈接問題 –
問題可能是它指向的域或文本在。嘗試使用不同的網域,例如鏈接到google.com或其他網站。並使用文本「谷歌」嘗試,如果這樣的作品。 – Arnold