This repository was archived by the owner on Feb 6, 2022. It is now read-only.
This repository was archived by the owner on Feb 6, 2022. It is now read-only.
Emails not sending from commands using memory spooling #127
Closed
Description
I'm using Symfony 2.7.3 and Swiftmailer 5.4.1 and according to the documentation (and from PR #64) these versions should automatically handle emails when memory spooling is used.
Emails are sending okay in controllers, so the config is setup correctly.
I've tried sending with the standard email code
$container = $this->getContainer();
$mailer = $container->get('mailer');
...
$email = \Swift_Message::newInstance()
->setSubject('New Email')
->setFrom('noreply@mydomain.com')
->setTo($recipients)
->setBody($message);
$mailer->send($email);
I also tried with the manual flush code at the end of the command
$spool = $mailer->getTransport()->getSpool();
$transport = $container->get('swiftmailer.transport.real');
$spool->flushQueue($transport);
Neither of these worked. (I've also checked that $recipients and $message are valid)
Metadata
Metadata
Assignees
Labels
No labels