Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -8,3 +8,3 @@ var stream = require('stream'); | ||
var mimelib = require('mimelib'); | ||
var addressparser = require('addressparser'); | ||
var addressparser = require('addressparser'); | ||
var CRLF = "\r\n"; | ||
@@ -34,3 +34,3 @@ var MIMECHUNK = 76; // MIME standard wants 76 char chunks when sending out. | ||
function person2address(l) | ||
function person2address(l) | ||
{ | ||
@@ -56,3 +56,3 @@ var addresses = addressparser(l); | ||
"message-id":"<" + now.getTime() + "." + (counter++) + "." + process.pid + "@" + os.hostname() +">", | ||
"date":moment().format("ddd, DD MMM YYYY HH:mm:ss ") + moment().format("Z").replace(/:/, '') | ||
"date":moment().locale('en').format("ddd, DD MMM YYYY HH:mm:ss ZZ") | ||
}; | ||
@@ -101,8 +101,8 @@ this.content = "text/plain; charset=utf-8"; | ||
Message.prototype = | ||
Message.prototype = | ||
{ | ||
attach: function(options) | ||
{ | ||
/* | ||
legacy support, will remove eventually... | ||
/* | ||
legacy support, will remove eventually... | ||
arguments -> (path, type, name, headers) | ||
@@ -127,3 +127,3 @@ */ | ||
/* | ||
/* | ||
legacy support, will remove eventually... | ||
@@ -238,6 +238,6 @@ should use Message.attach() instead | ||
} | ||
next.apply(null, args); | ||
}; | ||
var output_mixed = function() | ||
@@ -287,8 +287,8 @@ { | ||
header, | ||
headers = | ||
headers = | ||
{ | ||
'content-type': attachment.type + | ||
(attachment.charset ? "; charset=" + attachment.charset : "") + | ||
'content-type': attachment.type + | ||
(attachment.charset ? "; charset=" + attachment.charset : "") + | ||
(attachment.method ? "; method=" + attachment.method : ""), | ||
'content-transfer-encoding': 'base64', | ||
'content-transfer-encoding': 'base64', | ||
'content-disposition': attachment.inline ? 'inline' : 'attachment; filename="' + mimelib.encodeMimeWord(attachment.name, 'Q', 'utf-8') + '"' | ||
@@ -409,3 +409,3 @@ }; | ||
} | ||
else | ||
else | ||
self.emit('error', {message:"stream not readable"}); | ||
@@ -623,5 +623,5 @@ }; | ||
exports.BUFFERSIZE = BUFFERSIZE; | ||
exports.create = function(headers) | ||
exports.create = function(headers) | ||
{ | ||
return new Message(headers); | ||
}; |
@@ -31,2 +31,3 @@ var SMTPError = require('./error'); | ||
{ | ||
stream.end(); | ||
stream.emit('response', SMTPError('timedout while connecting to smtp server', SMTPError.TIMEDOUT, err)); | ||
@@ -33,0 +34,0 @@ }, |
1253
50354