From d6d8c2364436a4b76ba018e92fa1c34e071aca8c Mon Sep 17 00:00:00 2001 From: TheCartpenter Date: Thu, 5 Sep 2024 12:28:54 -0400 Subject: [PATCH] Added Message-ID in SMTP library as per MB --- upload/system/library/mail/smtp.php | 1 + 1 file changed, 1 insertion(+) diff --git a/upload/system/library/mail/smtp.php b/upload/system/library/mail/smtp.php index 2562c670d..0843b7fa7 100644 --- a/upload/system/library/mail/smtp.php +++ b/upload/system/library/mail/smtp.php @@ -82,6 +82,7 @@ public function send(): bool { $header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->option['reply_to']) . '?= <' . $this->option['reply_to'] . '>' . PHP_EOL; } + $header .= 'Message-ID: <' . base_convert(str_replace(['.', ' '], '', microtime()), 10, 36) . '.' . base_convert(bin2hex(openssl_random_pseudo_bytes(8)), 16, 36) . substr($this->option['from'], strrpos($this->option['from'], '@')) . '>' . PHP_EOL; $header .= 'Return-Path: ' . $this->option['from'] . PHP_EOL; $header .= 'X-Mailer: PHP/' . PHP_VERSION . PHP_EOL; $header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . PHP_EOL . PHP_EOL;