So im trying to make a script so i can mail all users in my database mailing them about updates etc the problem i have i can send a email to one user but not muti would this work?
$sql = 'SELECT email FROM users ORDER BY id';
foreach ($db->query($sql) as $row) {
$to = $_row['email'];
$subject = $_POST['subject'];
$txt = $_POST['comment'];
$headers = "From: admin@myemail.com" . "" .
"CC: admin@myemail.com";
mail($to,$subject,$txt,$headers);
}
I off course set the posts in a form before this is posted but would this be fine ?
