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 6860359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:23:57+00:00 2026-05-27T02:23:57+00:00

I need to send newsletters. I have already a PHP script that sends mass

  • 0

I need to send newsletters. I have already a PHP script that sends mass emails but it won’t work for long as email database is growing because of PHP max script run time.

So, to avoid it I came up with a solution: I would call my PHP script using AJAX in javascript and I will give it $_GET parameter with a count 20 so the script would sent only 20 emails. Than AJAX would receive success response, and call my script again and again till all emails are send.

Is it possible? I’m asking because I have never seen such a solution so I’m wondering if it is real (It’s kinda hard to implement this into my PHP framework so I’m asking experts here first)

To sum it up here’s a code skeleton:

<script>
var emailCount = 1000; //would get this from DB
var runCount = 20; //number of emails sent in one cycle
var from = 0; //start number
function sendMail(){
    if(from<emailCount){
        jQuery.ajaxfunction({
            path: 'script.php?from='+from+'&count='+runCount
            successFc: function(){
                from+=runCount;
                sendMail();
            }
        })
    }
}
sendMail();
</script>

So, are there any obstacles? Thanks a lot.

  • 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-05-27T02:23:57+00:00Added an answer on May 27, 2026 at 2:23 am

    Using AJAX

    Of course you can do it using AJAX, but in this case you should also make sure error parameter is also defined for .ajax() function in jQuery (see documentation). It will ensure the script will be invoked even if the previous call returned some error (such as error in your PHP script or something).

    Using Cron jobs

    Another idea is to use CRON jobs, which will call your script on constant interval and you won’t need your browser to be running all the time. See more about Cron. If you need solution for Windows (Cron is Unix-based), you can use for example Cron for Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send hundreds of newsletters, but would like to check first if
I need to send MMS thought a C# application. I have already found 2
I have a custom application that was built to send opt-in newsletters and marketing
I need a php script that you can use to set up a online
I need to send emails to a list of IDs from the contact application,
I need to send regular newsletters, as well as smaller batches, to a 10k
I need to send a newsletter to several thousands of subscribers with PHP. The
I'm creating a newsletter feature that will allow users to send emails. Since there
I am using phpmailer to send out newsletters, It seems to work out and
The situation is I have multiple webservices for which I need send request and

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.