From 2010094f838d6dc9ae8e94b404381c4386b36d9d 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 23e2d219..12aea27b 100644 --- a/system/functions.php +++ b/system/functions.php @@ -800,6 +800,7 @@ function getWorldName($id) */ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) { + /** @var PHPMailer $mailer */ global $mailer, $config; if(!$mailer) { @@ -807,6 +808,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']))