Avoid the doubledot issue in quoted-printable mail

When sending HTML mail using swiftmailer, the content will be encoded using quoted-printable. We may then encounter the "double dot" issue (doubled dot at the beginning of the line). This can be problematic with broken links to pictures for example.
This PR switches the encoding to base64.
This commit is contained in:
simicar29 2020-04-08 16:03:41 +02:00 committed by GitHub
parent 3ac07ff84f
commit 6cb780d125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -814,6 +814,10 @@ class CMailFile
if (!empty($conf->global->$keyforsmtppw)) $this->transport->setPassword($conf->global->$keyforsmtppw);
//$smtps->_msgReplyTo = 'reply@web.com';
// Switch content encoding to base64 - avoid the doubledot issue with quoted-printable
$contentEncoderBase64 = new Swift_Mime_ContentEncoder_Base64ContentEncoder();
$this->message->setEncoder($contentEncoderBase64);
// Create the Mailer using your created Transport
$this->mailer = new Swift_Mailer($this->transport);