Hi Vicente,
Just throwing code off the top of my head -- look in MassMail.inc.php for the loop:
- Code: Select all
foreach ($realRecipients as $recipient) {
Just above that, initialize the $lastSendTime variable:
- Code: Select all
$lastSendTime = 0;
Then, just inside the top of the loop, add a check and possible delay:
- Code: Select all
if ($lastSendTime == time()) {
sleep(1);
}
...and, inside the bottom of the loop...
- Code: Select all
$lastSendTime = time();
This is untested but should work. Note that it'll send out mass email sending *tremendously* -- to around one email per second -- so consider your number of subscribers and multiply accordingly. Watch out for PHP time limits or impatient browsers, which may cause PHP-based batch jobs like this to fail partway through. If that happens, you'll probably have to look into other ways of sending mail, as PHP is not good at long jobs.
Regards,
Alec Smecher
Public Knowledge Project Team