Mail list out of addresses in DB
Posted: Sun Feb 07, 2010 8:52 am
Is it possible to grab every users email from the database, then create a mailing list with them?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$message = $_POST['message'];
$from_header = "From: you@yourdomain.com";
$subject = "Newsletter";
$result = mysql_query("SELECT `email` FROM `users`");
while($row = mysql_fetch_array($result)) {
mail($row['email'], $subject, $message, $from_header);
}
?>