I am trying to configure swiftmailer in an extended yii 2.0 template. I went through a lot of messages, and I understand that there are some problems with gmail. My development environment in development is as follows:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => gethostbyname('smtp.gmail.com'),
'username' => 'xxx@gmail.com',
'password' => 'xxssxxxx',
'port' => '465',
'encryption' => 'ssl'
]
I also installed the support email that was used in the controller to the same gmail address in the main local config shown above. I tried switching to a less secure configuration for applications in my gmail account, and it didnβt work, and I donβt really like to change it. I get the following error when I use ssl encryption
unable to connect to host ... [# 0]
If I do not specify encryption, I get a timeout error.
OpenSSL phpinfo, . TLS , , (: '587' encryption = 'tls'),
stream_socket_enable_crypto(): SSL 1. OpenSSL : : 14090086: SSL: SSL3_GET_SERVER_CERTIFICATE:
, ? ? ?