Mass Emailing Issue

Posted on 2005-04-27
Last Modified: 2006-11-18
Hi! All,

Here is the summary of my problem.

I have a newsletter application in PHP in which I query the user database(which has on growing users...right now 40,000 users) to get the email addresses and query the newsletter table to attach the content and send emails. All this functionality is in one PHP page which runs everyday at some time using CRON job. Now the problem is when this program  runs, in a few minutes the mail server will be flooded with queued emails. Since our server is a shared server(Apache/Linux), all other clients cry because of the mail delivery delay.  

The mail sending page has one loop to iterate the users and inside that mail() function. I don't know what else I can do to avoid this flooding in the mail server...Can I create some delay in sending the emails? Will it help?

Your suggestion are greately appreciated.

Question by:prsupriya
    1 Comment
    LVL 5

    Accepted Solution

    Call your function n times during the night, and each time send 45000*1/n emails.

    count(*) and limit can help with the selection of e-mails from the DB.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now