A
A
Al Capone2020-09-06 20:08:42
Yii
Al Capone, 2020-09-06 20:08:42

What are the mail settings in web.php on yii2?

like this in web.php:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp. yandex.ru',
'username' => '****@yandex.ru',
'password' => '***',
'port' => '465',
'encryption' => 'ssl',
],
],

so in params.php
return [
'adminEmail' => '****@yandex.ru',
];

gives this error even though the data is entered correctly

Swift_TransportException
Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: Invalid user or password!
". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: Invalid user or password!
". Authenticator XOAUTH2 returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: Invalid user or password!
".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Al Capone, 2020-09-06
@anonim89

problem solved: insert 'useFileTransport' => true, after 'class' => 'yii\swiftmailer\Mailer',
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => true,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.yandex.ru',
....
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question