Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments from node.js to any smtp server", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors": ["izuzak"], |
@@ -1,2 +0,2 @@ | ||
#v0.1.11 | ||
#v0.1.12 | ||
@@ -3,0 +3,0 @@ ### emailjs |
@@ -104,6 +104,14 @@ var smtp = require('./smtp'); | ||
if(!err && next) | ||
{ | ||
next.apply(self, [stack]); | ||
} | ||
else | ||
stack.callback(err, stack.message); | ||
{ | ||
// if we snag on SMTP commands, call done, passing the error | ||
// but first reset SMTP state so queue can continue polling | ||
self.smtp.rset(function() | ||
{ | ||
self._senddone(stack, err); | ||
}); | ||
} | ||
}; | ||
@@ -142,3 +150,3 @@ | ||
_senddone: function(stack) | ||
_senddone: function(stack, err) | ||
{ | ||
@@ -148,3 +156,3 @@ var self = this; | ||
self.sending = false; | ||
stack.callback(null, stack.message); | ||
stack.callback(err, stack.message); | ||
self._poll(); | ||
@@ -151,0 +159,0 @@ } |
@@ -382,3 +382,3 @@ /* | ||
{ | ||
this.send("rset", callback); | ||
this.command("rset", callback); | ||
}, | ||
@@ -388,3 +388,3 @@ | ||
{ | ||
return this.send("noop", callback); | ||
this.send("noop", callback); | ||
}, | ||
@@ -391,0 +391,0 @@ |
43500
1406