Can anyone tell me if I am doing this correctly. I am trying to avoid emails being sent out from timing out, and also from being considered spam. I know if to many emails are sent at one time, it could be spam...
Well I know it emails, just dont know if the delay and quanity are working correctly, that is why I am asking if this is correct.
But also, how can i echo a count of emails it has sent ?
$query="select email from members";
$result = mysql_query($query) or die( "ERROR: " . mysql_error() . "\n");
while ($myrow = mysql_fetch_array($result)){
$email=$myrow["email"];
$x = 1;
$hold = 50; // quantity of emails sent before 3 sec delay
mailPoster($email,$curSubject[0],$ADMIN_EMAIL[0],$curMessage[0],$curTextMsg[0]);
$x++;
if($x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout
sleep(3);
$x = 0;
}
}