Skip to content

Commit

Permalink
Don't set overall encoding just because we're changing a sub-part - q…
Browse files Browse the repository at this point in the history
…uoted-printable and base64 are not valid encodings for a multipart container anyway.
  • Loading branch information
Synchro committed May 21, 2016
1 parent 7b9fd07 commit 59663fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2130,12 +2130,12 @@ public function createBody()
//Can we do a 7-bit downgrade?
if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
$bodyEncoding = '7bit';
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
$bodyCharSet = 'us-ascii';
}
//If lines are too long, and we're not already using an encoding that will shorten them,
//change to quoted-printable transfer encoding
//change to quoted-printable transfer encoding for the body part only
if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
$this->Encoding = 'quoted-printable';
$bodyEncoding = 'quoted-printable';
}

Expand All @@ -2144,10 +2144,11 @@ public function createBody()
//Can we do a 7-bit downgrade?
if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
$altBodyEncoding = '7bit';
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
$altBodyCharSet = 'us-ascii';
}
//If lines are too long, and we're not already using an encoding that will shorten them,
//change to quoted-printable transfer encoding
//change to quoted-printable transfer encoding for the alt body part only
if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
$altBodyEncoding = 'quoted-printable';
}
Expand Down

0 comments on commit 59663fd

Please sign in to comment.