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; }