From 6cb780d125fdd268288f7c6a5a75a76d7dc6faf5 Mon Sep 17 00:00:00 2001 From: simicar29 Date: Wed, 8 Apr 2020 16:03:41 +0200 Subject: [PATCH 1/2] 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. --- htdocs/core/class/CMailFile.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 6127a7d6044..8b6722b0977 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -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); From e402e35d96932f427a601966e411c3fd79d22655 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 8 Apr 2020 14:09:04 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 8b6722b0977..454673fe55b 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -817,7 +817,7 @@ class CMailFile // 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);