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 fbf8991 commit f1d80c6
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 @@ -363,6 +363,11 @@ if ($isHtml) {
$plainTextPart = rcube_mime::wordwrap($plainTextPart, $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 f1d80c6

Please sign in to comment.