I'm basically sending many emails using a while loop and accessing the name and email addresses from a mysql database.
I sent about 800 messages. It took about 5-10 minutes to complete and got maybe up to 100 errors over the course of the day.
I am sure some of the email addresses were no good but some were mail queue problems.
I'm just wondering if I could have done it a better way as this is something I will have to do again.
Here's my code:
$q="select name, email from email_table";
$r=mysql_query($q);
while ($a=mysql_fetch_array($r)) {
$to="$a[email]";
$subject="Email Subject";
$from="From: <sender@hostname.com>";
$message="fairly long text message";
mail($to, $subject, $message, $from);
}