Use mb_encode_mimeheader instead of quoted_printable_encode to ensure properly encoded subjects, add custom mail header
Hanno Böck

Hanno Böck commited on 2020-05-24 09:46:55
Zeige 1 geänderte Dateien mit 2 Einfügungen und 2 Löschungen.

... ...
@@ -479,8 +479,8 @@ function send_mail($address, $subject, $body)
479 479
     if (strstr($subject, "\n") !== false) {
480 480
         die("Zeilenumbruch im subject!");
481 481
     }
482
-    $header = "From: ".config('company_name')." Web Administration <noreply@".config('masterdomain').">\r\nReply-To: ".config('adminmail')."\r\nCc: ".config('adminmail')."\r\nContent-Type: text/plain; charset=\"utf-8\"\r\nContent-Transfer-Encoding: quoted-printable";
483
-    $subject = "=?UTF-8?Q?".quoted_printable_encode($subject)."?=";
482
+    $header = "From: ".config('company_name')." Web Administration <noreply@".config('masterdomain').">\r\nReply-To: ".config('adminmail')."\r\nCc: ".config('adminmail')."\r\nContent-Type: text/plain; charset=\"utf-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\nX-schokokeks-org-message: webinterface";
483
+    $subject = mb_encode_mimeheader($subject, "utf-8", "Q");
484 484
     $body = quoted_printable_encode($body);
485 485
     mail($address, $subject, $body, $header);
486 486
 }
487 487