I'm trying to mount an array with the list of email addresses for phpmailer to send. But I'm having problems.
No error is displayed, php simply does not send the emails.
I am mounting the array like this:
// Define os destinatário(s)
$consulta = $mysqli->query("select email,nome from clientes where status=true");
while ($resultado = mysqli_fetch_object($consulta)) {
// Monta o array
$destinatario[] = array($resultado->email => $resultado->nome);
}
And send it like this:
foreach($destinatario as $email_cliente => $name){
$mail->AddBCC($email_cliente, $name);
}
Can anyone help me? I think the problem is in the array assembly.