Robert is saying that comperatively, my script versus his, his would be faster. Not much faster, but faster.
It's also a possiblity to do a foreach() function. May be the same speed as Roberts. YOu would do that as follows:
<?php
$query = "SELECT Email FROM `emails`";
$result = mysql_query($result);
$display = mysql_fetch_array($result);
foreach($display as $address){
mail($address, $subject, $message, $headers);
}
Not 100% sure that would be faster, but is much less code. But basically what you would be doing is putting an array together of the 9k emails, and then shooting them off.
It may even be better to list all of them in a variable:
$email_to = '';
while($display = mysql_fetch_array($result)){
$email_to .= $display['Email'].'; ';
}
And include a header that hides all the email addresses, and only shows a generic list name as the To: field.
To: Need not contain the recipients address, but when in the header portion of the email, the To: field is over-ridden with the To: header's value. So if you say:
To: My Email List
and send it to 9k recipients, each person would get an email and in the To: column/line it would say "My Email List" and NOT the email address.
~Brett