diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index c2435499af..cca3dfa335 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -917,13 +917,14 @@ final class PhabricatorMetaMTAMail if ($send_html) { $html_body = idx($params, 'html-body'); - - // NOTE: We just drop the entire HTML body if it won't fit. Safely - // truncating HTML is hard, and we already have the text body to fall - // back to. - if (strlen($html_body) <= $body_limit) { - $mailer->setHTMLBody($html_body); - $body_limit -= strlen($html_body); + if (strlen($html_body)) { + // NOTE: We just drop the entire HTML body if it won't fit. Safely + // truncating HTML is hard, and we already have the text body to fall + // back to. + if (strlen($html_body) <= $body_limit) { + $mailer->setHTMLBody($html_body); + $body_limit -= strlen($html_body); + } } }