From 1629e01df938de9074c850b62b238921ce3f00e8 Mon Sep 17 00:00:00 2001 From: sc2bigjoe Date: Wed, 17 Dec 2014 11:28:50 -0500 Subject: [PATCH] Update smtp.js added the ability for smtp appender to send message as html instead of plaintext. in your log4js.config file simply include "html": "true", to write out as html, otherwise it will send plaintext --- lib/appenders/smtp.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/appenders/smtp.js b/lib/appenders/smtp.js index 85accee..fa3e775 100644 --- a/lib/appenders/smtp.js +++ b/lib/appenders/smtp.js @@ -34,9 +34,15 @@ function smtpAppender(config, layout) { var msg = { to: config.recipients, subject: config.subject || subjectLayout(firstEvent), - text: body, headers: { "Hostname": os.hostname() } }; + + if (!config.html) { + msg.text = body; + } else { + msg.html = body; + } + if (config.sender) { msg.from = config.sender; }