tags:

views:

22

answers:

1

I have about 50 users in a database and I want to send them a newsletter.

$result = mysql_query("SELECT email FROM users") or die(mysql_error());  
$row = mysql_fetch_array( $result ); // had 50 emails

How do I put the $row['email'] into the mail code below.

$m->setBcc(Array("[email protected]", "[email protected]","[email protected]"));

Let me know.

+2  A: 
$recipients = array();

while($row=mysql_fetch_array($result))
{
 $recipients[] = $row['email'];
}

$m->setBcc($recipients);

tell me if it doesn't work and I'll immediately delete it :)

Ygam
Thank you Ygam. It's working like a super power.
kampit