Permalink
Browse files

Allow the mailcomposer encoding to be specified

  • Loading branch information...
skabbes committed Apr 30, 2012
1 parent 4a2d9da commit 8fb65b8b64ef4bf182639f02ccd9470d0ba30539
Showing with 9 additions and 4 deletions.
  1. +1 −0 README.md
  2. +8 −4 lib/nodemailer.js
View
@@ -328,6 +328,7 @@ The following are the possible fields of an e-mail message:
- **attachments** - An array of attachment objects.
- **envelope** - optional SMTP envelope, if auto generated envelope is not suitable
- **messageId** - optional Message-Id value, random value will be generated if not set. Set to false to omit the Message-Id header
+ - **encoding** - optional transfer encoding for the textual parts (defaults to "quoted-printable")
All text fields (e-mail addresses, plaintext body, html body) use UTF-8 as the encoding.
Attachments are streamed as binary.
View
@@ -83,11 +83,15 @@ function sendMail(options, callback){
*/
function Nodemailer(options){
this.options = options || {};
-
+
this.transport = this.options.transport;
-
- this.mailcomposer = new MailComposer();
-
+
+ if( this.options.encoding ){
+ this.mailcomposer = new MailComposer({encoding: this.options.encoding});
+ } else {
+ this.mailcomposer = new MailComposer();
+ }
+
if(!this.transport){
this.transport = this.getGlobalTransport();
}

0 comments on commit 8fb65b8

Please sign in to comment.