我在让 nodemailer 与 AuthSMTP ( https://www.authsmtp.com/ ) 一起工作时遇到问题。
var nodemailer = require('nodemailer');
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
auth: {
user: '...',
pass: '...'
}
};
var transporter = nodemailer.createTransport(transOptions);
var mainOptions = {
from: 'whatever@domain.com',
to: 'something@domain.com',
subject: 'hello',
text: 'hello world!'
};
var callback = function(err, info){
if (err) { throw err }
console.log('sent');
}
transporter.sendMail(mainOptions, callback);
我从 AuthSMTP 返回的错误是:
"Your program, application or device is trying to use SSL with our service but SSL is not enabled on your account."
我不想启用 SSL,并且我将传输选项对象中的 secure
属性设置为 false
,如文档所述:https://github.com/andris9/nodemailer-smtp-transport#usage .
当我将 nodemailer
设置为不使用 SSL 时,为什么 AuthSMTP 会说我正在使用 SSL...?
最佳答案
你可以试试这个
var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
ignoreTLS: true
auth: {
user: '...',
pass: '...',
}
关于node.js - NodeJS - 使用 nodemailer-smtp-transport 的 nodemailer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34356160/