Skip to content

Commit

Permalink
refactor: Consider multiple 'to' e-mail addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
ammopt committed Jun 20, 2024
1 parent 904c783 commit 19b0e48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/web/sys/Email/SMTPSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 19b0e48

Please sign in to comment.