+7
-8
@@ -28,3 +28,2 @@ var email = require('emailjs'), | ||
| files, file, body, templateName, templates = {}, | ||
| smtpClient, smtpConf, | ||
| i, len; | ||
@@ -54,3 +53,3 @@ | ||
| smtpConf = { | ||
| this.smtpConf = { | ||
| username: conf.username || "", | ||
@@ -65,5 +64,4 @@ password: conf.password || "", | ||
| }; | ||
| this.smtpClient = new email.server.connect(smtpConf); | ||
| debug(this); | ||
| debug(this); | ||
| debug('ENV=' + ENV); | ||
@@ -96,3 +94,3 @@ }; | ||
| var text, headers, message, | ||
| var text, headers, message, smtpClient, | ||
| callback = conf.callback || function(){}; | ||
@@ -108,3 +106,4 @@ | ||
| if (ENV !== 'test') { | ||
| this.smtpClient.send(message, callback); | ||
| smtpClient = new email.server.connect(this.smtpConf); | ||
| smtpClient.send(message, callback); | ||
| } else { | ||
@@ -159,2 +158,2 @@ conf.callback.call(this, null, message); | ||
| module.exports = Mai; | ||
| module.exports = Mai; |
+2
-2
| { | ||
| "name": "mai", | ||
| "description": "send text/html e-mail with mail template management feature", | ||
| "version": "0.0.1", | ||
| "version": "0.0.2", | ||
| "author": "Kazuyuki Honda <hakobera@gmail.com>", | ||
@@ -14,2 +14,2 @@ "dependencies": { | ||
| "engines": { "node": ">= 0.4.2 < 0.5.0" } | ||
| } | ||
| } |
9023
-0.2%