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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:36:45+00:00 2026-05-19T04:36:45+00:00

I have a forum, where users can subscribe to a particular thread. When someone

  • 0

I have a forum, where users can subscribe to a particular thread. When someone replies to the thread, the reply is added to the DB and an email alert is sent to all the subscribers before the success page is displayed.

FYI – I am not using PHP’s mail function, as my hosting provider has a limit of 500 per hour. I am using Google App Engine to send out the emails via curl.

The problem – when the number of subscribers is more than a hundred or so, the user has to wait for way too long before the success page is displayed, because PHP has to loop through each subscriber first. Is there a way to circumvent this without resorting to inserting the emails in the DB and then processing them via a cron?

Hope I’ve made sense – thanks in advance for your advice!

  • 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-19T04:36:46+00:00Added an answer on May 19, 2026 at 4:36 am

    You can write your mail script and force it to run in the background using a shell command.

    shell_exec("/path/to/php /path/to/send_notifications.php 'var1' 'var2' >> /path/to/alert_log/paging.log &");
    

    Using the shell_exec function of PHP, you can tell PHP to run a script in the background. The parameters you see in the shell_exec command are seperated by spaces.

    • /path/to/php – The actual path to PHP on the server (you should be able to just use ‘php’ here)
    • /path/to/send_notifications.php – The path to your mail script
    • 'var1' 'var2' – $_SERVER['argv'] variables you can send to your script will be put in single quotes and spaced after the path to your script.
    • >> /path/to/alert_log/paging.log – Path to a log file (optional), anything echo’ed in your mail script will be written to this file
    • & – The most important part of this. The & tells your server to run this script in the background

    Doing it this way, when you execute the mail script, the user submitting the form will not have to wait for the script to finish. The browser will load the page faster and the user can browse away from the confirmation page or even close the browser and the script will continue to run until its completed.

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

Sidebar

Related Questions

I have a form where users can subscribe and unsubcribe to my email list.
I have an input form used for a forum, where users can post messages.
I have a dynamic website - all content depends on users. As you can
I want to show a subscribe/unsubscribe link on a forum topic list page, along
There is a checkbox added in user profile form, subscribe to daily newsletter. I
In my iPhone app Im using StoreKit to make it possible for users to
Ok, long story short I have a Windows service that handles Win32_VolumeChangeEvent and logs
While I search this one out on my own, may be some one could
I often need to check if expr1==expr2 , where checking for symbolic equality is

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.