Comparing version 0.1.3 to 0.1.4
@@ -22,3 +22,3 @@ //var email = require('emailjs'); | ||
TEXT: 'i hope this works', | ||
HTML: 'i <i>hope</i> <b>this</b> works', | ||
HTML: '<html><body>i <i>hope</i> <b>this</b> works</body></html>', | ||
ATTACH: | ||
@@ -43,4 +43,5 @@ { | ||
var msg = email.message.create({text:MESSAGE.TEXT, from:MESSAGE.FROM, to:MESSAGE.TO, subject:MESSAGE.SUBJECT}); | ||
msg.attach_alternative(MESSAGE.HTML).attach(ATTACH.PATH, ATTACH.TYPE, ATTACH.NAME); | ||
msg.attach_alternative(MESSAGE.HTML).attach(MESSAGE.ATTACH.PATH, MESSAGE.ATTACH.TYPE, MESSAGE.ATTACH.NAME); | ||
server.send(msg, function(err, message) { console.log(err || message); }); |
{ | ||
"name": "emailjs", | ||
"description": "send emails, html and attachments from node.js to any smtp server", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors" : [ |
@@ -62,3 +62,3 @@ #v0.1.2 | ||
// attach an alternative html email for those with advanced email clients | ||
message.attach_alternative("i <i>hope</i> this works!"); | ||
message.attach_alternative("<html>i <i>hope</i> this works!</html>"); | ||
@@ -107,2 +107,5 @@ // attach attachments because you can! | ||
// you can actually pass any headers you want to send, the below are just the | ||
// most common ones you would want to use, from and to being required... | ||
headers = | ||
@@ -109,0 +112,0 @@ { |
@@ -31,3 +31,3 @@ var stream = require('stream'); | ||
// if(/cc|bcc|to|from|reply-to|sender|subject|date|message-id/i.test(header)) | ||
this.header[header] = headers[header]; | ||
this.header[header.toLowerCase()] = headers[header]; | ||
} | ||
@@ -158,8 +158,8 @@ }; | ||
data = data.concat(["--", boundary, CRLF]); | ||
data = data.concat(["Content-Type: text/html", CRLF, "Content-Transfer-Encoding: quoted-printable", CRLF, "Content-Disposition: inline", CRLF, CRLF]); | ||
data = data.concat([self.message.html, CRLF, CRLF]); | ||
data = data.concat(["Content-Type:text/plain", CRLF, "Content-Transfer-Encoding: quoted-printable", CRLF, "Content-Disposition: inline", CRLF, CRLF]); | ||
data = data.concat([self.message.text, CRLF, CRLF]); | ||
data = data.concat(["--", boundary, CRLF]); | ||
data = data.concat(["Content-Type: text/plain", CRLF, "Content-Transfer-Encoding: quoted-printable", CRLF, "Content-Disposition: inline", CRLF, CRLF]); | ||
data = data.concat([self.message.text, CRLF, CRLF]); | ||
data = data.concat(["Content-Type:text/html", CRLF, "Content-Transfer-Encoding: quoted-printable", CRLF, "Content-Disposition: inline", CRLF, CRLF]); | ||
data = data.concat([self.message.html, CRLF, CRLF]); | ||
@@ -166,0 +166,0 @@ data = data.concat(["--", boundary, "--", CRLF, CRLF]); |
42281
137