Add improvements

This commit is contained in:
Philipp 2020-09-19 22:49:44 +02:00
parent 874cef6a19
commit 5663e61791
No known key found for this signature in database
GPG Key ID: 9A28B7D4FF5667BD

View File

@ -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)));
}
}