if we have no text body, but only a PDF or an image, set binary, as it's already base64 transfer-encoded, when recreating the mail with a different subject

This commit is contained in:
ralf 2024-03-05 18:00:53 +02:00
parent b65dca49e5
commit 858eebd527

View File

@ -7326,6 +7326,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));