mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
fix merge email.js
This commit is contained in:
parent
7da7887ed2
commit
fa8d31609e
@ -73,11 +73,10 @@ module.exports = function(RED) {
|
||||
if (msg != null) {
|
||||
if (smtpTransport) {
|
||||
node.status({fill:"blue",shape:"dot",text:"sending"});
|
||||
var payload = RED.util.ensureString(msg.payload);
|
||||
|
||||
var payload = RED.util.ensureString(msg.payload);
|
||||
smtpTransport.sendMail({
|
||||
from: node.userid, // sender address
|
||||
to: node.name, // comma separated list of receivers
|
||||
to: msg.to || node.name, // comma separated list of addressees
|
||||
subject: msg.topic, // subject line
|
||||
text: payload // plaintext body
|
||||
}, function(error, info) {
|
||||
@ -178,7 +177,7 @@ module.exports = function(RED) {
|
||||
pay.date = Imap.parseHeader(buffer).date[0];
|
||||
} else {
|
||||
var parts = buffer.split("Content-Type");
|
||||
for (var p in parts) {
|
||||
for (var p = 0; p < parts.length; p++) {
|
||||
if (parts[p].indexOf("text/plain") >= 0) {
|
||||
pay.payload = parts[p].split("\n").slice(1,-2).join("\n").trim();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user