?
Solved

Mass Emailing Issue

Posted on 2005-04-27
1
Medium Priority
?
175 Views
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.

Thanks,
S:
0
Comment
Question by:prsupriya
1 Comment
 
LVL 5

Accepted Solution

by:
rmaranhao earned 2000 total points
ID: 13881887
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.

Regards,
Roberto.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month16 days, 17 hours left to enroll

862 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