Stephen Last Stephen Last -5 years ago 473
Node.js Question

NodeJS nodemailer - IIS SMTP Virtual Server

I'm trying to use

( to send e-mail using a local windows server we have, with an SMTP Virtual Server.

The SMTP Virtual Server works fine, we already use Jmail in Classic ASP, pass it the server name, and email gets sent.

var nodemailer = require('nodemailer');
var options = {
var transporter = nodemailer.createTransport(options);
var email = {
from: '',
to: '',
subject: 'hello',
text: 'hello world!'
var callback = function(err, info){
if (err) { throw err }
transporter.sendMail(email, callback);

The error I get back from this is:

Can't send mail - all recipients were rejected: 550 5.7.1 Unable to
relay for

If I update the
object to include
, like this:

var options = {
auth: {
user: '...',
pass: '...'

I get this error:

Invalid login: 504 5.7.4 Unrecognized authentication type

How can I use
to send e-mail using our IIS SMTP Virtual Server..?

Answer Source

I still don't know why the above doesn't work, pointing nodemailer to our SMTP Virtual Server. However I've worked around it.

Our SMTP Virtual Server is setup to use our Office 365 account, so I've updated my nodemailer code to go to Office 365 direct, rather than via our local server.

var options = {
    host: '',
    port: 25,
    secure: false,
    ignoreTLS: false,
    auth: {
        user: '...',
        pass: '...'
    tls: {
        ciphers: 'SSLv3'

This works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download