]> git.mxchange.org Git - friendica-addons.git/commitdiff
Add improvements
authorPhilipp <admin@philipp.info>
Sat, 19 Sep 2020 20:49:44 +0000 (22:49 +0200)
committerPhilipp <admin@philipp.info>
Sat, 19 Sep 2020 20:49:44 +0000 (22:49 +0200)
phpmailer/phpmailer.php

index 2b38f07a6ac2d464f69dfa3ac2f9d2822cc9bbb5..5b43c8f19b00518bb792eb962919b1f8571fbb32 100644 (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)));
                        }
                }