$mail = \Swift_Message::newInstance()
->setSubject($message->getSubject())
->setFrom($message->getEmail())
->setBody($message->getBody());
$this->get('mailer')->send($mail);
Mails are not sent when using swiftmailer. Yet, when I go step by step in the debugger, it seems to send the email and returns sent=1. However I don't receive anything in my mailbox (gmail). I use my gmail account for sending emails, as shown below:
parameters:
mailer_transport: gmail
mailer_host: ~
mailer_user: [email protected]
mailer_password: my-password
delivery_address: [email protected]
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
I've checked apache error log, nothing. I've run php app/console swiftmailer:spool:send
just in case, but no luck.
What could prevent emails from being sent ?