We have a large community base, more than 1Mill and rapidly increasing, that we regularly need to send large number of emails to, generally about 25,000 emails at a time (per day).
The community records, emails, are in a MySQL DB.
We used to send these emails via JSP but for various reasons we need to redo it in Php. The code in JSP has modules (classes) that would regulate how many emails were sent out every few minutes, keeping it at about 100 emails per 5 minutes.
The mail server is Qmail.
Write the Php code that sends emails out every 5 minutes, 100 emails at a time.
If you write a Php code that gets the emails from MySQL and then loops through them to send them out 100 emails at a time via the mail function and then stops for 5 minutes via sleep command, this will kill the MySQL DB from where the emails are selected from for Hours and Hours which means kills all dynamically generated web pages of the Web site.
So what is the solution?
What do you suggest is the right way of achieving the above objective?