title: With Symfony2 and Swiftmailer, how do I listen for exceptions thrown when spooled emails are actually sent?
body: <p>I'm using Swiftmailer and Symfony to send email. My config is set to spool the email, and I'm using a third-party SMTP server (MailJet). It all works fine. <strong><em>But if I give Swiftmailer a wrong password for the SMTP server, it just fails silently.</em></strong></p>
  
  <p>When I turn off spooling so that it's sent immediately, I see that Swiftmailer is throwing a TransportException. However, when it's being spooled, this Exception is thrown during Symfony's <code>kernel.terminate</code> event so it just gets ignored. There's nothing in the logs of either Symfony or nginx so I don't actually know whether the exception is thrown.</p>
  
  <p>So how can I detect a failure to connect to the SMTP server if it's thrown during the <code>kernel.terminate</code> event so that I can log it in Monolog?</p>