简体   繁体   中英

getting 500 internet server error on godaddy while using php email

i want to send email to my 600 clients through php email. but the loop works till 20 contacts, after that it show 500 internal server error... i am using go daddy server.

<?php
for($x=1;$x<=600;$x++)
{
$con = mysqli_connect("host","database","password");
if (!$con){die('Could not connect: ' . mysqli_error($con));}
mysqli_select_db($con,"database");
$sql="SELECT email FROM emails Where id = ".$x;
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result);
$to = $row['email'];
if ($to == "NULL")
{

}
else
{
  echo $row['email'];
mysqli_close($con);
// mail($to,"subject","message");
sleep(2);
}
}
?>

Trying to send unlimited mails in a short period time is restricted by most of the hosting servers. If u continuously try to do this, they may even block ur hosting account temporarily or permanent.
But if u want to send unlimited mails there are lot of third party mail services available. U can use those to send unlimited mails.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM