Hello
I have a website and I have about 2000 emails in database and I want to send an email to them.

I use this code:

PHP Code:
$headers  "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: My Name <myemail@mywebsite>\r\n";
$headers .= "X-Priority: 1\r\n";

$result mysql_query("select * from table");
while (
$row mysql_fetch_array($result)) {
  
mail ($row[Email],<title>,$message,$headers);
  echo 
$row[Email] . "<br>";

When it's starting sending, after a minute it shows me "HTTP Page Error 500".
It sends about 200 emails then it stops and shows "HTTP Page Error 500".

What's the problem?
How can I solve it?


Thanks