minor: Support html content in mailer.php

This commit is contained in:
Hardway Hou 2022-05-24 10:09:46 +08:00
parent 1b3e655f89
commit b91ffae292
1 changed files with 9 additions and 1 deletions

View File

@ -45,7 +45,15 @@ class Mailer {
++$hooks_tried; ++$hooks_tried;
} }
$headers = [ "From: $from_combined", "Content-Type: text/plain; charset=UTF-8" ]; $headers = [ "From: $from_combined" ];
if($message_html){
$headers[]="MIME-Version: 1.0";
$headers[]="Content-Type: text/html; charset=UTF-8";
}
else{
$headers[]="Content-Type: text/plain; charset=UTF-8";
}
$rc = mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers))); $rc = mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers)));