add envelope to email node options

as part of node-red#875
This commit is contained in:
Dave Conway-Jones 2016-05-19 10:13:47 +01:00
parent 34c42eed61
commit b23cf0b788
3 changed files with 8 additions and 6 deletions

View File

@ -77,6 +77,7 @@
The filename should be set using <code>msg.filename</code>. Optionally <code>msg.description</code> can be added for the body text.</p>
<p>Alternatively you may provide <code>msg.attachments</code> which should contain an array of one or
more attachments in <a href="https://www.npmjs.com/package/nodemailer#attachments" target="_new">nodemailer</a> format.</p>
<p>If required by your recipient you may also pass in a <code>msg.envelope</code> object, typically containing extra from and to properties.</p>
<p>Note: uses SMTP with SSL to port 465.</p>
</script>

View File

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

View File

@ -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.*",