Yii2 send emails with gmail smtp

Passo 1 Creare un account Gmail Passs 2 Nel file di configurazione /config/web.php avremo questa struttura: ‘mailer’ => [ ‘class’ => ‘yii\swiftmailer\Mailer’, ‘viewPath’ => ‘@app/mail’, ‘transport’ => [ ‘class’ => ‘Swift_SmtpTransport’, ‘host’ => ‘smtp.gmail.com’, ‘username’ => ‘YOUR ACCOUNT GMAIL@gmail.com’, ‘password’ => ‘YOUR PASSWORD’, ‘port’ => ‘587’,’encryption’ => ‘tls’,’streamOptions’ => [‘ssl’ => [‘allow_self_signed’ => true,’verify_peer’ =>…