Results 1 to 3 of 3

Thread: getting 500 internet server error while using php email

  1. #1
    Junior Member
    Join Date
    Jun 2015
    Posts
    1

    getting 500 internet server error while using php email

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

  2. #2
    Moderator
    Join Date
    Sep 2013
    Location
    Maryland, USA
    Posts
    692
    Have you tried contacting hostforlife's tech support? They may have a maximum of 20 outgoing emails in quick succession (or similar) limit.

  3. #3
    Friend of Staff fancyf's Avatar
    Join Date
    Apr 2002
    Location
    ƒ@ncyville
    Posts
    1,393
    https://css-tricks.com/forums/topic/...ing-php-email/

    So you solved anything? Would be nice to know.
    Anti-wrinkle cream there may be, but anti-b astard cream there is not..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •