$body.. $reply.. and $subject all from form on submitting page:
<?php
MYSQL_CONNECT($HOST,$USER, $PASS) or DIE
("Cannot Connect to Database");
@mysql_select_db("$DATABASE") or DIE ("Unable to select database")
$query = "SELECT Email FROM $TABLE";
$return = MYSQL_QUERY($query);
$rows = MYSQL_NUMROWS($return);
$i = 0;
while($i < $rows) {
$email = mysql_result($return);
mail($email,$subject,$body,"Reply-To: $from\n");
$i++;
}// end while
MYSQL_CLOSE();
?>
This should send out as many emails as you have people in your databases. Now this probably isnt perfect code. 🙂 But this should get you started. Now this doesnt check for errors so it assumes that all input is good input (bad very bad). So you can put in a little error checking.
Finally I am not shure I would do this in PHP, as its going to take a little while to send all 10000 emails. Someone said that he could send out I think 10 emails a minute, so we are talking almost 2 hours to send out all 10000 emails. If you wrote something like this is C or something you could probably cut your time way down (as it will do multiprocesses ie. Forks).
Hope this Helps!