Browse code

Use mb_encode_mimeheader instead of quoted_printable_encode to ensure properly encoded subjects, add custom mail header

Hanno Böck authored on24/05/2020 09:46:55
Showing1 changed files
... ...
@@ -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
 }