1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Tweaks to email error rmessages

This commit is contained in:
Dave C-J 2014-05-02 15:16:11 +01:00
parent 1309b9a72d
commit df9744084c
2 changed files with 9 additions and 3 deletions

View File

@ -21,7 +21,7 @@ var util = require('util');
try { try {
var emailkey = RED.settings.email || require(process.env.NODE_RED_HOME+"/../emailkeys.js"); var emailkey = RED.settings.email || require(process.env.NODE_RED_HOME+"/../emailkeys.js");
} catch (err) { } catch (err) {
util.log("[61-imap.js] Advise : No Email credentials found."); //util.log("[61-imap.js] Info : No Email credentials found.");
} }
if (emailkey) { if (emailkey) {

View File

@ -17,7 +17,12 @@
var RED = require(process.env.NODE_RED_HOME+"/red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require('util'); var util = require('util');
var nodemailer = require("nodemailer"); var nodemailer = require("nodemailer");
var Imap = require('imap'); var Imap = null;
try {
Imap = require('imap');
} catch (e) {
util.log("[61-email.js] - imap npm not installed - no inbound email available");
}
//console.log(nodemailer.Transport.transports.SMTP.wellKnownHosts); //console.log(nodemailer.Transport.transports.SMTP.wellKnownHosts);
@ -85,7 +90,6 @@ function EmailNode(n) {
} }
RED.nodes.registerType("e-mail",EmailNode); RED.nodes.registerType("e-mail",EmailNode);
function EmailInNode(n) { function EmailInNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.name = n.name; this.name = n.name;
@ -202,7 +206,9 @@ function EmailInNode(n) {
node.emit("input",{}); node.emit("input",{});
} }
if (Imap != null) {
RED.nodes.registerType("e-mail in",EmailInNode); RED.nodes.registerType("e-mail in",EmailInNode);
}
var querystring = require('querystring'); var querystring = require('querystring');