Skip to content

Commit 8225c78

Browse files
committed
better headers for text and html
1 parent a3a60ac commit 8225c78

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/mailComposer/mailComposer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,10 @@
608608
MailComposer.prototype._prepareTextPart = function(bodyPart, callback){
609609

610610
if(!this._body.text.match(/[\u0080-\uFFFF]/)){
611-
bodyPart.headers["Content-Type"] = "text/plain; format=flowed";
611+
bodyPart.headers["Content-Type"] += "; format=flowed";
612612
bodyPart.flowed = true;
613613
}else{
614+
bodyPart.headers["Content-Type"] += "; charset=utf-8";
614615
bodyPart.headers["Content-Transfer-Encoding"] = "quoted-printable";
615616
bodyPart.quotedPrintable = true;
616617
}
@@ -626,9 +627,10 @@
626627
*/
627628
MailComposer.prototype._prepareHTMLPart = function(bodyPart, callback){
628629
if(!this._body.html.match(/[\u0080-\uFFFF]/)){
629-
bodyPart.headers["Content-Type"] = "text/html; format=flowed";
630+
bodyPart.headers["Content-Type"] += "; format=flowed";
630631
bodyPart.flowed = true;
631632
}else{
633+
bodyPart.headers["Content-Type"] += "; charset=utf-8";
632634
bodyPart.headers["Content-Transfer-Encoding"] = "quoted-printable";
633635
bodyPart.quotedPrintable = true;
634636
}

0 commit comments

Comments
 (0)