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

Let email out node set secure connection explicitly

to close #1148
This commit is contained in:
Dave Conway-Jones 2017-02-13 22:43:43 +00:00
parent 93c85ca7cd
commit 367237d946
3 changed files with 8 additions and 3 deletions

View File

@ -35,7 +35,10 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-port"><i class="fa fa-random"></i> <span data-i18n="email.label.port"></span></label> <label for="node-input-port"><i class="fa fa-random"></i> <span data-i18n="email.label.port"></span></label>
<input type="text" id="node-input-port" placeholder="465"> <input type="text" id="node-input-port" placeholder="465" style="width:100px">
<label style="width:40px"> </label>
<input type="checkbox" id="node-input-secure" style="display:inline-block; width:20px; vertical-align:baseline;">
Use secure connection.
</div> </div>
<div class="form-row"> <div class="form-row">
<label for="node-input-userid"><i class="fa fa-user"></i> <span data-i18n="email.label.userid"></span></label> <label for="node-input-userid"><i class="fa fa-user"></i> <span data-i18n="email.label.userid"></span></label>
@ -77,6 +80,7 @@
defaults: { defaults: {
server: {value:"smtp.gmail.com",required:true}, server: {value:"smtp.gmail.com",required:true},
port: {value:"465",required:true}, port: {value:"465",required:true},
secure: {value: true},
name: {value:""}, name: {value:""},
dname: {value:""} dname: {value:""}
}, },

View File

@ -29,6 +29,7 @@ module.exports = function(RED) {
this.name = n.name; this.name = n.name;
this.outserver = n.server; this.outserver = n.server;
this.outport = n.port; this.outport = n.port;
this.secure = n.secure;
var flag = false; var flag = false;
if (this.credentials && this.credentials.hasOwnProperty("userid")) { if (this.credentials && this.credentials.hasOwnProperty("userid")) {
this.userid = this.credentials.userid; this.userid = this.credentials.userid;
@ -58,7 +59,7 @@ module.exports = function(RED) {
var smtpTransport = nodemailer.createTransport({ var smtpTransport = nodemailer.createTransport({
host: node.outserver, host: node.outserver,
port: node.outport, port: node.outport,
secure: node.useSSL, secure: node.secure,
auth: { auth: {
user: node.userid, user: node.userid,
pass: node.password pass: node.password

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-email", "name": "node-red-node-email",
"version": "0.1.16", "version": "0.1.17",
"description": "Node-RED nodes to send and receive simple emails", "description": "Node-RED nodes to send and receive simple emails",
"dependencies": { "dependencies": {
"nodemailer": "^1.11.0", "nodemailer": "^1.11.0",