web-dev-qa-db-fra.com

php mail bcc plusieurs destinataires

Comment puis-je créer un mail Cci?

$to=array();
$members_query = mysql_query("select email from members");
while( $row = mysql_fetch_array($members_query) )
{
    array_Push($to, $row['email']);
}

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

// Additional headers
//$headers .= 'To: '.$newName.' <'.$newEmail.'>' . "\r\n";
$headers .= 'From: SmsGratisan.com <[email protected]' . "\r\n";


mail(implode(',', $to), $title, $content, $headers);

Merci!

20
user1936192

Définissez votre champ mail sur null, puis implodez votre tableau $to dans vos en-têtes.

$headers .= 'From: SmsGratisan.com <[email protected]' . "\r\n";
$headers .= 'BCC: '. implode(",", $to) . "\r\n";


mail(null, $title, $content, $headers);
26
Mike Mackintosh
$headers .= 'Bcc: [email protected]' . "\r\n";
0
FlourishDNA