diff --git a/social/email/61-email.js b/social/email/61-email.js index bb049fe2e..2bf854853 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -52,18 +52,18 @@ module.exports = function(RED) { } var node = this; - var smtpTransport = nodemailer.createTransport({ + var smtpOptions = { host: node.outserver, port: node.outport, secure: node.secure - }); - + } if(this.userid && this.password) { - smtpTransport.auth = { + smtpOptions.auth = { user: node.userid, pass: node.password }; } + var smtpTransport = nodemailer.createTransport(smtpOptions); this.on("input", function(msg) { if (msg.hasOwnProperty("payload")) {