From 19b0e48f97022ce09818dfec67727cc01af48108 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 20 Jun 2024 13:23:34 +0000 Subject: [PATCH] refactor: Consider multiple 'to' e-mail addresses --- code/web/sys/Email/SMTPSetting.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/web/sys/Email/SMTPSetting.php b/code/web/sys/Email/SMTPSetting.php index ec9c34583a..5816289a5b 100644 --- a/code/web/sys/Email/SMTPSetting.php +++ b/code/web/sys/Email/SMTPSetting.php @@ -112,7 +112,11 @@ function sendEmail($to, $replyTo, $subject, $body, $htmlBody, $attachments){ $mail->From = $this->from_address; $mail->FromName = $this->from_name; - $mail->addAddress($to); + + $toAddresses = explode(';', $to); + foreach ($toAddresses as $toAddress) { + $mail->addAddress($toAddress); + } for($i = 0; $i < sizeof($attachments['name']); $i++){ $mail->addAttachment($attachments['tmp_name'][$i], $attachments['name'][0]);