One problem which took me some time till I figured it out regards the sending of emails within a command when memory spooling is configured for swiftmailer. It just doesn't sent any mails! The reason is very simple once you look in the right direction: Memory spooling means the emails get sent on the kernel terminate event, which never happens when a command is executed. The issue is discussed on github.
The solution is also simple: Either change the configuration to file spooling or no spooling at all (maybe in a special environment which is then used to execute the commands) or sent all spooled mails within your command. Here is some code how this can be achieved (most of the example is copied from \Symfony\Bundle\SwiftmailerBundle\Command\SendEmailCommand):
class EmailCommand extends ContainerAwareCommand
protected function execute(InputInterface $input, OutputInterface $output)
// Do your stuff, queuing emails and such
// And right before you are done, sent the emails
$mailer = $
$spool = $mailer->getTransport()->getSpool();
I ended up using the file spooling, mostly because I will end up using it anyway for all emails triggered by user actions and because I don't like this kind of code inside my commands.