2009-08-23 23 views
0
<?php include("admin/db.php"); 
$recipients = "SELECT * FROM recipients ORDER BY id DESC"; 
$email_list = $db->query($recipients); 
foreach($email_list as $row) { 
    echo $row['email'].","; 
} 

$to = "?"; 

?> 

上記の私は$変数に挿入する必要がある電子メールのカンマ区切りリストを持っています。これはどうすればいいですか?

答えて

0
foreach($email_list as $row) { 
    echo $row['email'].","; 


    mail($row['mail'], $subject, $body) 

} 
1
$recipients = "SELECT * FROM recipients ORDER BY id DESC"; 
while ($row = mysql_fetch_array($recipients)) 
{ 
    $adresses[] = $row['email']; 
} 

$to = implode(",",$adresses); 
関連する問題