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 acab3ca856
commit 5cf6253f77

View File

@ -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));