Stephen Last Stephen Last - 5 months ago 52
Node.js Question

NodeJS - nodemailer using nodemailer-smtp-transport

I'm having an issue getting nodemailer to work with 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);


The error I'm getting back from AuthSMTP is:


"Your program, application or device is trying to use SSL with our
service but SSL is not enabled on your account."


I don't want to enable SSL, and I have the
secure
property in the transport options object set to
false
as the docs say: https://github.com/andris9/nodemailer-smtp-transport#usage.

Why would AuthSMTP say I'm using SSL when I'm setting
nodemailer
not to use SSL...?

Answer

you may try this

var transOptions = {
host: 'mail.authsmtp.com',
port: 25,
secure: false,
ignoreTLS: true
auth: {
    user: '...',
    pass: '...',

}