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 committed May 29, 2016
1 parent f82e336 commit 4489441
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 @@ -394,6 +394,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

1 comment on commit 4489441

@alecpl
Copy link
Member

@alecpl alecpl commented on 4489441 May 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would be even better to just skip setTXTBody() (and related code) in such cases.

Please sign in to comment.