PHP Mail $to multiple recipients from database table

Posted by Alok Jethanandani on Stack Overflow See other posts from Stack Overflow or by Alok Jethanandani
Published on 2009-08-23T04:35:57Z Indexed on 2010/03/26 13:03 UTC
Read the original article Hit count: 458

Filed under:
|
|
|
<?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 = "?";

?>

Above I have a comma delimitated list of emails which I need to insert into the $to variable. How do I do this?

© Stack Overflow or respective owner

Related posts about php

Related posts about mail