diff options
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r-- | lib/sendgrid.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js index 0a8a0a9..870bd7b 100644 --- a/lib/sendgrid.js +++ b/lib/sendgrid.js @@ -186,8 +186,8 @@ SendGrid.prototype.getMultipartData = function(email, boundary) { data.push(new Buffer(encodeField(boundary, k, v))); }); - _(email.files).each(function(filepath, filename) { - data.push(encodeFile(boundary, mime.lookup(filepath), 'files[' + filename + ']', path.basename(filepath))); + _(email.files).each(function(file) { + data.push(encodeFile(boundary, file.contentType, 'files[' + file.filename + ']', file.filename)); data.push(new Buffer(email.file_data[filename])); data.push(new Buffer('\r\n')); }); |