Mass Emailing Issue

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.

Who is Participating?
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.