From 5663e61791e996cbfbadff116481f6e20e0639cb Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 19 Sep 2020 22:49:44 +0200 Subject: [PATCH] Add improvements --- phpmailer/phpmailer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpmailer/phpmailer.php b/phpmailer/phpmailer.php index 2b38f07a..5b43c8f1 100644 --- a/phpmailer/phpmailer.php +++ b/phpmailer/phpmailer.php @@ -91,11 +91,13 @@ function phpmailer_emailer_send_prepare(App $a, IEmail &$email) // additional headers if (!empty($email->getAdditionalMailHeader())) { foreach ($email->getAdditionalMailHeader() as $name => $values) { - // Skip the "Message-ID" header because PHP-Mailer is using its own + // Set the "Message-ID" header for PHP-Mailer directly if ($name == 'Message-Id') { - continue; + // implode all values to one entry, because there's only one value possible + $mailer->MessageID = trim(implode("", $values)); + } else { + $mailer->addCustomHeader(trim($name), trim(implode("\n", $values))); } - $mailer->addCustomHeader(trim($name), trim(implode("\n", $values))); } }