Add cc and bcc options to email node

to close #209
This commit is contained in:
Dave Conway-Jones
2016-06-03 16:14:20 +01:00
parent 4248b580ee
commit b6f45ef8d4
3 changed files with 17 additions and 12 deletions

View File

@@ -88,6 +88,10 @@ module.exports = function(RED) {
}
var sendopts = { from: node.userid }; // sender address
sendopts.to = node.name || msg.to; // comma separated list of addressees
if (node.name === "") {
sendopts.cc = msg.cc;
sendopts.bcc = msg.bcc;
}
sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
if (msg.hasOwnProperty("envelope")) { sendopts.envelope = msg.envelope; }
if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead