From c863ad460a30550492a566b5d25b2e084469c5f4 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 8 Jun 2018 21:08:00 +0200 Subject: [PATCH] * fixed multiple mail recipients when using admin mailer function It resulted in mail being sent to all users multiple times.. --- system/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/functions.php b/system/functions.php index fd34a5d6..110b7c7e 100644 --- a/system/functions.php +++ b/system/functions.php @@ -810,6 +810,7 @@ function getWorldName($id) */ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) { + /** @var PHPMailer $mailer */ global $mailer, $config; if(!$mailer) { @@ -817,6 +818,9 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer = new PHPMailer(); $mailer->setLanguage('en', LIBS . 'phpmailer/language/'); } + else { + $mailer->clearAllRecipients(); + } $signature_html = ''; if(isset($config['mail_signature']['html']))