Hello world

$subject, 'to' => $to, 'message' => $message ]; } public static function send() { foreach(self::$mails as $mail) { mail($mail['to'], $mail['subject'], $mail['message']); } } } //In your script you can call anywhere MailSpool::addMail('Hello', 'kai.hendry@example.com', 'Hello from the spool'); register_shutdown_function('MailSpool::send'); ?>