Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -11,3 +11,3 @@ # emailjs [![Build Status](https://secure.travis-ci.org/eleith/emailjs.png)](http://travis-ci.org/eleith/emailjs) | ||
- works with SSL and TLS smtp servers | ||
- supports smtp authentication (PLAIN, LOGIN, CRAMMD5) | ||
- supports smtp authentication ('PLAIN', 'LOGIN', 'CRAM-MD5', 'XOAUTH2') | ||
- emails are queued and the queue is sent asynchronously | ||
@@ -150,3 +150,3 @@ - supports sending html emails and emails with multiple attachments (MIME) | ||
domain // domain to greet smtp with (defaults to os.hostname) | ||
authentication // array of preferred authentication methods (ex: email.authentication.PLAIN, email.authentication.XOAUTH2) | ||
authentication // array of preferred authentication methods ('PLAIN', 'LOGIN', 'CRAM-MD5', 'XOAUTH2') | ||
} | ||
@@ -181,2 +181,6 @@ | ||
## email.SMTP.authentication | ||
associative array of currently supported SMTP authentication mechanisms | ||
## attachment | ||
@@ -183,0 +187,0 @@ |
@@ -88,3 +88,3 @@ var smtp = require('./smtp'); | ||
&& (msg.to || msg.cc || msg.bcc) | ||
&& (msg.text || this._containsInlinedHtml(msg.attachment))) | ||
&& (msg.text !== undefined || this._containsInlinedHtml(msg.attachment))) | ||
msg = message.create(msg); | ||
@@ -91,0 +91,0 @@ |
@@ -320,3 +320,3 @@ var stream = require('stream'); | ||
var buffer = new Buffer(chunk); | ||
var closed = function(fd) { fs.close(fd); }; | ||
var closed = function(fd) { if(fs.close) { fs.close(fd); } }; | ||
var opened = function(err, fd) | ||
@@ -330,4 +330,14 @@ { | ||
{ | ||
var encoding = attachment && attachment.headers ? attachment.headers['content-transfer-encoding'] || 'base64' : 'base64'; | ||
if (encoding === 'ascii' || encoding === '7bit') { | ||
encoding = 'ascii'; | ||
} else if(encoding === 'binary' || encoding === '8bit') { | ||
encoding = 'binary'; | ||
} else { | ||
encoding = 'base64'; | ||
} | ||
// guaranteed to be encoded without padding unless it is our last read | ||
output_base64(buffer.toString("base64", 0, bytes), function() | ||
output_base64(buffer.toString(encoding, 0, bytes), function() | ||
{ | ||
@@ -334,0 +344,0 @@ if(bytes == chunk) // we read a full chunk, there might be more |
53189
1291
221