ServerGrove Blog: Spooling emails with Symfony2 on VPS and Shared Hosting
Note: This article was originally published at PHPDeveloper on 30 April 2012.
When you send an email, the mailer communicates with a remote server in charge of receiving the message and of delivering it to the recipient. This process can cause your form to submit slowly as it depends on how fast the mail server responds. Spooling allows us to decouple the application execution line from the process of the sending one, two, or as many emails as we need.
They show you how to configure the SwiftMailerBundle with the mail server's settings, how to set up the command to send the emails and the settings you'll need to put in your cron file to run the "send" operation periodically.