I\'m having trouble emailing around 30 or so users from a MySQL database; some of the emails get to the intended person ... some never arrive. The script below executes in around 5 seconds (the table of users is literally about 30 rows) ..
The code is as follows :
$query =\"SELECT username, password, email, country FROM researchers_email\";
$result = mysql_query($query);
while ($section = mysql_fetch_array($result))
{
// Here is our password....
$db_user = $section[0];
$db_pass = $section[1];
$db_email = $section[2];
$subject = \"CM 01/02 Test Version v3.945\";
$body = \"bodygoeshere\";
$from = \"From: doubli@sigames.com\\nX-Mailer: PHP/\" . phpversion();
mail(\"$db_email\", \"$subject\", \"$body\", \"$from\");
print (\"Emailed : $db_user at $db_email with the password $db_pass<BR>\");
}
I know it\'s impossible to test that the email is delivered; but even though I know the addresses I have for people are correct only around 30% of emails ever arrive?