I run a MySQL query to get firstname, lastname and email from a table where \'notify\' is set to YES, like this below. And in the while loop, I create all the info which I
Your array isn't well constructed, use the following:
array
while ($row = mysqli_fetch_array($getnotify)) { $notifyemailscontent[$row['email']] = "{$row['firstname']} {$row['lastname']}"; }
Then, inside the phpmailer block:
phpmailer
foreach($notifyemailscontent as $email => $name) { $mail->AddCC($email, $name); }