Skip to content

Commit

Permalink
Avoid sending completely empty text parts for multipart/alternative m…
Browse files Browse the repository at this point in the history
…essages (#5283)
  • Loading branch information
thomascube authored and alecpl committed Jul 19, 2016
1 parent acf633c commit 7b37ef8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions program/steps/mail/sendmail.inc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ if ($isHtml) {
$plainTextPart = rcube_mime::wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n", false, $message_charset);
$plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);

// completely blank text part confuses some mail clients
if ($plainTextPart == '') {
$plainTextPart = "\r\n";
}

// make sure all line endings are CRLF (#1486712)
$plainTextPart = preg_replace('/\r?\n/', "\r\n", $plainTextPart);

Expand Down

0 comments on commit 7b37ef8

Please sign in to comment.