1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| $destinataire=["---","---","---","---","---","---" ];
foreach($destinataire as $dest) {
$mail->AddAddress($dest);
$mail->SetLanguage("en",'phpmailer/language/');
$mail->From = $mailemetteur;
$mail->Subject = "test";
// construction msg
//-------------------
$msg="test é è";
$msg = htmlentities($msg,ENT_NOQUOTES,'UTF-8',false);
$msg = str_replace(array('<','>'),array('<','>'), $msg);
$msg = str_replace(array('&lt;','&gt'),array('<','>'), $msg);
//fin construction msg
//------------------------
$mail->CharSet = 'UTF-8';
$mail->ContentType ='text/html';
$mail->FromName=$mail;
$mail->Body = $msg;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
} //fin gestion multi-destinataires |
Partager