diff --git a/social/email/61-email.html b/social/email/61-email.html index 4ebc4865..bfddae01 100644 --- a/social/email/61-email.html +++ b/social/email/61-email.html @@ -77,6 +77,7 @@ The filename should be set using msg.filename. Optionally msg.description can be added for the body text.

Alternatively you may provide msg.attachments which should contain an array of one or more attachments in nodemailer format.

+

If required by your recipient you may also pass in a msg.envelope object, typically containing extra from and to properties.

Note: uses SMTP with SSL to port 465.

@@ -178,13 +179,13 @@ } } }; - + $("#node-input-useSSL").change(function(x, y) { console.log("useSSL: x="+ JSON.stringify(x) + ", y=" + y); console.log("Value: " + $("#node-input-useSSL").prop("checked")); checkPorts(); }); - + $("#node-input-protocol").change(function() { var protocol = $("#node-input-protocol").val(); if (protocol === "IMAP") { @@ -192,7 +193,7 @@ $(".node-input-disposition").show(); } else { $(".node-input-box").hide(); - $(".node-input-disposition").hide(); + $(".node-input-disposition").hide(); } checkPorts(); }); @@ -210,7 +211,7 @@

Note: uses IMAP with SSL to port 993.

Any attachments supplied in the incoming email can be found in the msg.attachments property. This will be an array of objects where each object represents a specific attachments. The format of the object is:

- +
 {
   contentType:        // The MIME content description
@@ -240,7 +241,7 @@
             server: {value:"imap.gmail.com",required:true},
             useSSL: {value: true},
             port: {value:"993",required:true},
-            box: {value:"INBOX"}, // For IMAP, The mailbox to process 
+            box: {value:"INBOX"}, // For IMAP, The mailbox to process
             disposition: { value: "None" }, // For IMAP, the disposition of the read email
             repeat: {value:"300",required:true}
         },
diff --git a/social/email/61-email.js b/social/email/61-email.js
index bda5efc2..178bf2f9 100644
--- a/social/email/61-email.js
+++ b/social/email/61-email.js
@@ -89,6 +89,7 @@ module.exports = function(RED) {
                     var sendopts = { from: node.userid };   // sender address
                     sendopts.to = node.name || msg.to; // comma separated list of addressees
                     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
                         if (!msg.filename) {
                             var fe = "bin";
diff --git a/social/email/package.json b/social/email/package.json
index cd5961bf..9ea93d9d 100644
--- a/social/email/package.json
+++ b/social/email/package.json
@@ -1,6 +1,6 @@
 {
     "name"          : "node-red-node-email",
-    "version"       : "0.1.5",
+    "version"       : "0.1.6",
     "description"   : "Node-RED nodes to send and receive simple emails",
     "dependencies"  : {
         "nodemailer"   : "1.11.*",