Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added optional output character set option

  • Loading branch information...
commit a1c36aa6d2e17c3f1b348974c04f63ce7acdd421 1 parent 71ddc6b
Andris Reinman authored
Showing with 12 additions and 5 deletions.
  1. +1 −0  README.md
  2. +10 −4 lib/nodemailer.js
  3. +1 −1  package.json
1  README.md
View
@@ -409,6 +409,7 @@ The following are the possible fields of an e-mail message:
- **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")
+ - **charset** - optional output character set for the textual parts (defaults to "utf-8")
All text fields (e-mail addresses, plaintext body, html body) use UTF-8 as the encoding.
Attachments are streamed as binary.
14 lib/nodemailer.js
View
@@ -82,16 +82,22 @@ function sendMail(options, callback){
* @param {Object} options Message options object, see README for the complete list of possible options
*/
function Nodemailer(options){
+ var mailcomposerOptions = {};
+
this.options = options || {};
this.transport = this.options.transport;
- if( this.options.encoding ){
- this.mailcomposer = new MailComposer({encoding: this.options.encoding});
- } else {
- this.mailcomposer = new MailComposer();
+ if(this.options.encoding){
+ mailcomposerOptions.encoding = this.options.encoding;
+ }
+
+ if(this.options.charset){
+ mailcomposerOptions.charset = this.options.charset;
}
+ this.mailcomposer = new MailComposer(mailcomposerOptions);
+
if(!this.transport){
this.transport = this.getGlobalTransport();
}
2  package.json
View
@@ -1,7 +1,7 @@
{
"name": "nodemailer",
"description": "Easy to use module to send e-mails, supports unicode and SSL/TLS",
- "version": "0.3.29",
+ "version": "0.3.30",
"author" : "Andris Reinman",
"maintainers":[
{
Please sign in to comment.
Something went wrong with that request. Please try again.