diff --git a/api/src/Mail.php b/api/src/Mail.php index eb0faf8e3f..f6d16a547c 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -7323,6 +7323,11 @@ class Mail $structure->setTransferEncoding('8bit'); $structure->setCharset('utf-8'); } + // if we have no text body, but only a PDF or an image, set binary, as it's already base64 transfer-encoded + if ($structure->getType() === 'application/pdf' || $structure->getPrimaryType() === 'image') + { + $structure->setTransferEncoding('binary', ['send' => true]); + } $mailer->setBasePart($structure); //error_log(__METHOD__.__LINE__.':'.array2string($structure));