summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorscottmotte <scott@scottmotte.com>2013-12-10 16:33:17 -0700
committerscottmotte <scott@scottmotte.com>2013-12-10 16:33:17 -0700
commitfe8c2863eed10c3bdf06b302d1dae2cb4989e610 (patch)
tree07af18fe2c20690cad19838e688b3f1cd1d2f791 /lib
parent605cb8fdc364fc01e860096d7762712d3d4d7573 (diff)
downloadsendgrid-nodejs-fe8c2863eed10c3bdf06b302d1dae2cb4989e610.zip
sendgrid-nodejs-fe8c2863eed10c3bdf06b302d1dae2cb4989e610.tar.gz
sendgrid-nodejs-fe8c2863eed10c3bdf06b302d1dae2cb4989e610.tar.bz2
Fixes Issue #108
Diffstat (limited to 'lib')
-rw-r--r--lib/email.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/email.js b/lib/email.js
index 9e5f204..ef4a3c4 100644
--- a/lib/email.js
+++ b/lib/email.js
@@ -257,6 +257,8 @@ Email.prototype.toSmtpFormat = function() {
};
if (this.bcc) { smtp.bcc = this.bcc; }
+ if (this.toname) { smtp.to = [this.toname, " <", smtp.to, ">"].join(""); }
+ if (this.fromname) { smtp.sender = [this.fromname, " <", smtp.sender, ">"].join(""); }
smtp.headers['x-smtpapi'] = this.smtpapi.toJson();