Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8422023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:19:10+00:00 2026-06-10T03:19:10+00:00

I am on a standard shared Hostgator which has a limit of 500 mails

  • 0

I am on a standard shared Hostgator which has a limit of 500 mails per hour.

I am trying to throttle my email script to only send 1 email per 8 seconds…

$query=mysql_query("SELECT email FROM users WHERE verified='1' ORDER BY balance DESC");
while($arr=mysql_fetch_array($query)){
set_time_limit(30);
$mail->AddAddress($arr[0]);
$mail->Send();
$mail->ClearAddresses();
echo "Sent to ".$arr[0]."<br><br>";
sleep(8);
}

I am using PHPMailer. The script itself works fine, it emails once every 8 seconds…

But the rest of the domain freezes up completely.

Is there an alternative method of sleeping I can use that won’t freeze up my whole domain?

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:19:11+00:00Added an answer on June 10, 2026 at 3:19 am

    Cronjobs cannot be executed secondly, only minutely. */1 in the minute field will run the script every 1 minute, but you cannot get any more granular than that.

    There is nothing wrong with the sleep, but do not run the command from your browser. The reason you are locking up the domain is because your Apache thread is held up on the script with sleep. Until it finishes, your requests will be blocked and queued.

    I would suggest that you keep your script, and just execute it with a cronjob hourly, or every few hours. How often does it really need to run? Once a day?

    The below will run it every night at 5 after midnight, and throw it to the background.

    5 0 * * * user php -f /path/to/file &
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a SharedAssemblyInfo file which seems to be a 'standard' technique: http://blogs.msdn.com/jjameson/archive/2009/04/03/shared-assembly-info-in-visual-studio-projects.aspx
I have an algorithm written in PHP which communicates with MySQL. On standard shared
I have a shared hosting mySql instance which has it's system_time_zone set to Pacific
We have a coding standard that says all shared (static) fields and methods must
Does the POSIX standard allow a named shared memory block to contain a mutex
I have a site running MVC and Nhibernate (not fluent) using standard session per
I have a shared library say foo.so which contains a function called initialize() .
I am using a shared hosting through CIPL.in. They use cpanel. I am trying
I'm trying to get Lucene.NET to work on a shared hosting environment. Mascix over
In C11 standard there is following definition of common initial sequence shared by structures

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.