$sql = "select emailid from table where category = 1";
while($row=mysql_fetch_array($sql))
{
$email=$row['emailid'];
$to = $email;
$subject = "E-mail subject";
$body = "E-mail body";
$headers = 'From: info@mydomain.com' . "
" ;
$headers .= 'Reply-To: info@mydomain.com' . "
";
mail($to, $subject, $body, $headers);
}
Suppose the above code will fetch 100 e-mail ids from database and send the mail one by one to each e-mail id. but what i want to do is.... fetch all e-mail ids in an array and send them as 'BCC' to each e-mail at once. one more thing i want to customize the e-mail body content for each id....
Any ideas?