database; $context = $database->context; $res = ""; $cfg = $this->cfg; $bounce_address = $cfg->bounce_address; $messageid_host = $cfg->messageid_host; $mailer = $this->mailer; for($i = 0; $i < $limit; $i++) { $context->beginTransaction(); if($finaldestination = $database->get_random_unsent_destination()) $finaldestination->sent = true; $context->commit(); if(!$finaldestination) break; $dst = $finaldestination->address; die("REMOVE BEFORE FLIGHT $dst\n"); $message = $finaldestination->as_message(); $mailer->send($message); usleep(100000); // FIXME: variable depending on size of e-mail } return $res; } }