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 Jun 28, 2016
1 parent 412982a commit 334b339
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 @@ -388,6 +388,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 334b339

Please sign in to comment.