node.js - NodeJS - 使用 nodemailer-smtp-transport 的 nodemailer

标签 node.js email ssl nodemailer

我在让 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/

相关文章:

python - 创建 Python 电子邮件(接收)服务器

PHP:从 POP3 或 IMAP 下载收到的电子邮件,解析它,并在服务器上将其标记为已读/删除

php - PHP邮件功能无法完成电子邮件的发送

mod-rewrite - SSL 重写重定向 apache2

node.js - 在模型中创建模型

javascript - 无法看到node js程序的延迟

ssl - 在 Domain.com 上设置 SSL

java - 在 Java 中禁用证书验证的危险

python - 将 url 路径重定向到端口

node.js - 不允许 POST 请求 - 不允许 405 - nginx,即使包含 header