I've got about 25,000 people in a database that all want to receive company e-mails. I wrote a mailer program so that I could knock up HTML pages and send them off to the people, but now the list is so long that it is causing problems. The server times out, the browser needs to stay open for ages, ... not very economical or robust at the moment
A sample of the code is below, you get the idea, I need a better system, any ideas?
$query="SELECT * FROM user WHERE email<>'' AND subscribe=1";
$query.=" GROUP BY email LIMIT ".$start.",".$limit;
$result=@db_query($query);
while ($details=@db_fetch_array($result)) {
@mail($details["email"],stripslashes($subject),$send_message,$headers."\nContent-Type: text/html; charset=iso-8859-1");
}