Fix error due to: 503 bad command sequence #21

Closed
wants to merge 1 commit into
from
View
@@ -818,8 +818,14 @@ SMTPClient.prototype._actionDATA = function(str){
// response should be 354 but according to this issue https://github.com/eleith/emailjs/issues/24
// some servers might use 250 instead, so lets check for 2 or 3 as the first digit
if([2,3].indexOf(Number(str.charAt(0)))<0){
- this._onError(new Error("Data command failed - " + str), false, str);
- return;
+
+ if( str.charAt(0)!='5' )
+ {
+ this._onError(new Error("Data command failed - " + str), false, str);
+ return;
+ }
+
+ this.close();
}
// Emit that connection is set up for streaming