My PHPmailer sends letters to users through a cycle, but it turns out that it sends one letter to all users instead of each one. It simply adds comma-separated emails to recipients and that's it ...

How can I fix this?

    1 answer 1

    Perhaps this will help you https://stackoverflow.com/questions/8451680/phpmailer-foreach-loop

    $mail->ClearAddresses(); // remove previous email addresses