diff --git a/system/functions.php b/system/functions.php index f11fa382..df58193f 100644 --- a/system/functions.php +++ b/system/functions.php @@ -878,11 +878,12 @@ function getWorldName($id) * * @param string $to Recipient email address. * @param string $subject Subject of the message. - * @param string $body Message body in html format. + * @param string $body Message body in HTML format. * @param string $altBody Alternative message body, plain text. * @return bool PHPMailer status returned (success/failure). + * @throws \PHPMailer\PHPMailer\Exception */ -function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) +function _mail(string $to, string $subject, string $body, string $altBody = ''): bool { global $mailer, $config; @@ -900,12 +901,6 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->clearAllRecipients(); } - $signature_html = setting('core.mail_signature_html'); - if($add_html_tags && isset($body[0])) - $tmp_body = '' . $body . '

' . $signature_html . ''; - else - $tmp_body = $body . '

' . $signature_html; - $mailOption = setting('core.mail_option'); if($mailOption == MAIL_SMTP) { @@ -932,6 +927,9 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->isMail(); } + $signature_html = setting('core.mail_signature_html'); + $tmp_body = $body . '

' . $signature_html; + $mailer->isHTML(isset($body[0]) > 0); $mailer->From = setting('core.mail_address'); $mailer->Sender = setting('core.mail_address');