I have written a custom console command to query my database, produce a report and e-mail it to an address; however I can not seem to successfully send the e-mail. I can sen
Just add this to the end of your execute action:
$container = $this->getContainer(); $mailer = $container->get('mailer'); $spool = $mailer->getTransport()->getSpool(); $transport = $container->get('swiftmailer.transport.real'); $spool->flushQueue($transport);