I
I
ipokos2018-11-12 18:10:52
Yii
ipokos, 2018-11-12 18:10:52

Why are emails not being sent to Yii2 (error 220)?

When sending an email: Expected response code 220 but got an empty response

'mail' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@backend/mail',
            'useFileTransport' => false,
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.gmail.com',
                'username' => 'my_email',
                'password' => 'may_password',
                'port' => '465',
                'encryption' => 'ssl',

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2018-11-12
@alexxxst

Maybe it's time from the last decade to the present?

'port' => '587',
'encryption' => 'tls',

D
Dmitry, 2018-11-12
@slo_nik

Good evening.
Log in to your gmail account and allow "insecure apps" .
If you did not make a mistake in "username" and "password", then letters should be sent with your current settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question