From 54b2ab00d3d141d1418c8892a9f76dec38e1773f Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Mon, 6 Oct 2025 09:21:07 +0200 Subject: [PATCH] Fix $cid assembly --- src/PHPMailer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 8df4c394..242c6b38 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -4604,7 +4604,7 @@ class PHPMailer */ public function msgHTML($message, $basedir = '', $advanced = false) { - $cid_domain = '@phpmailer.0'; + $cid_domain = 'phpmailer.0'; if (filter_var($this->From, FILTER_VALIDATE_EMAIL)) { //prepend with a character to create valid RFC822 string in order to validate $cid_domain = substr($this->From, strrpos($this->From, '@') + 1); @@ -4631,7 +4631,7 @@ class PHPMailer } //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places //will only be embedded once, even if it used a different encoding - $cid = substr(hash('sha256', $data), 0, 32) . $cid_domain; //RFC2392 S 2 + $cid = substr(hash('sha256', $data), 0, 32) . '@' . $cid_domain; //RFC2392 S 2 if (!$this->cidExists($cid)) { $this->addStringEmbeddedImage( @@ -4665,7 +4665,7 @@ class PHPMailer $directory = ''; } //RFC2392 S 2 - $cid = substr(hash('sha256', $url), 0, 32) . $cid_domain; + $cid = substr(hash('sha256', $url), 0, 32) . '@' . $cid_domain; if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { $basedir .= '/'; }