I'm trying to send emails using gmail configuration but I can't. I'm not having any errors; I also checked the symfony log files. Nothing crashed, but no emails are sent :( I also ran the swiftmailer:spool:send command (maybe the emails were in the spool) and as a result I received: sent 0 emails.
I'm using the dev environment, in my config_dev.yml:
swiftmailer:
transport: gmail
username: myuser@gmail.com
password: mypass
In the controller(just for test):
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('send@example.com')
->setTo('myemail@mydomain.com')
->setBody(
"some test body"
)
;
$this->get('mailer')->send($message);
Thanks in advance
UPDATE: I switch to prod environment, same results: no errors... until i ran the command and I got this error:
[Swift_TransportException]
Connection could not be established with host smtp.gmail.com [Unable to fin
d the socket transport "ssl" - did you forget to enable it when you configu
red PHP? #50346848]
Then, I uncomment this line in the php.ini
extension=php_openssl.dll
but nothing, the same result :(
I also modified the memory to file in swiftmailer config and the email is there, in cache:
app\cache\prod\swiftmailer\spool
PS: I'm not behind any proxy