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

  • Home
  • SEARCH
  • 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 8618249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:03:42+00:00 2026-06-12T06:03:42+00:00

I need to write my own email dispatcher in php/mysql. I’m using Amazon’s SES

  • 0

I need to write my own email dispatcher in php/mysql. I’m using Amazon’s SES to send emails. I have records of who and what needs to be emailed in a “Queue” MySQL table. Each record gets deleted upon a successful email send. I would like to send these emails out as fast as possible but i need to keep Amazon’s quota in mind. They restrict your allowed emails-sent/second.

How can i arrange this to not exceed the limit? I know i can write a php cron script that will only pull X number of records from the Queue and send those, but if my cron only runs once per minute, there is a lot of wasted time. (X being the quota limit/second)

On the other hand, if my email quota gets bumped and i can send 1000/per second(or something ridiculous), i’m probably going to run into problems if my script takes a long time to execute. The cron could potentially fire again and pull the same records from the Queue table.

  • 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-12T06:03:43+00:00Added an answer on June 12, 2026 at 6:03 am

    You should create a lock file when you execute the script and remove it when the execution is complete. Then you can alert yourself if the script is being run again without the previous execution being complete.

    $filename = 'sending_emails.txt';
    if (file_exists($filename)) {
        mail('your@email.com', 'Execution overlap', 'Adjust script parameters!');
        exit;
    }
    file_put_contents('sending_emails.txt', '1');
    // Send e-mail logic here
    unlink($filename);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write to a text file using JavaScript. I have a machine
I need to write the output of the code I have to a file
I need to write my own SSL socket (CSocket ansestor) with server side certificate
I need to write my own function that returns the most repeated value of
I will need to write my own drivers for few controllers in my chipset.I
Do you ever need to write your own HTML, CSS or JavaScript files for
I am trying to write my own Script, because i have not found Jquery
I need to write my own code editor in browser. I found CodeMirror but
I need to write a system to generate HTML email from a data model
I need to write my own memory allocation functions for the GMP library, since

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.