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:
parent
ec5f4485f8
commit
1629e01df9
@ -34,9 +34,15 @@ function smtpAppender(config, layout) {
|
|||||||
var msg = {
|
var msg = {
|
||||||
to: config.recipients,
|
to: config.recipients,
|
||||||
subject: config.subject || subjectLayout(firstEvent),
|
subject: config.subject || subjectLayout(firstEvent),
|
||||||
text: body,
|
|
||||||
headers: { "Hostname": os.hostname() }
|
headers: { "Hostname": os.hostname() }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!config.html) {
|
||||||
|
msg.text = body;
|
||||||
|
} else {
|
||||||
|
msg.html = body;
|
||||||
|
}
|
||||||
|
|
||||||
if (config.sender) {
|
if (config.sender) {
|
||||||
msg.from = config.sender;
|
msg.from = config.sender;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user