Skip to content

Commit

Permalink
Only set AltBody default text if HTML conversion results in nothing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Jan 22, 2014
1 parent e1023b6 commit 01f4c43
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 @@ -2844,12 +2844,13 @@ public function msgHTML($message, $basedir = '', $advanced = false)
}
}
$this->isHTML(true);
if (empty($this->AltBody)) {
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n";
}
//Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
$this->Body = $this->normalizeBreaks($message);
$this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
if (empty($this->AltBody)) {
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
self::CRLF . self::CRLF;
}
return $this->Body;
}

Expand Down

0 comments on commit 01f4c43

Please sign in to comment.