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
This commit is contained in:
sc2bigjoe 2014-12-17 11:28:50 -05:00
parent ec5f4485f8
commit 1629e01df9

View File

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