Jump to content

Goinfory

New Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Goinfory

  1. Hi, 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 hostforlife server. Here is the script:

    <?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);
    }
    }
    ?>
    

    Please help me, Thanks! :)

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.