summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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();