anonim89
@anonim89
frontend, backend

Какие настройки почты в web.php на yii2?

Вот так прописано в web.php:

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

Так в params.php:

return [
    'adminEmail' => '****@yandex.ru',
];

Выдаёт такую ошибку, хотя данные введены верно:

Swift_TransportException
Failed to authenticate on SMTP server with username "kirill.romantik@yandex.ru" 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!
".
  • Вопрос задан
  • 691 просмотр
Решения вопроса 1
anonim89
@anonim89 Автор вопроса
frontend, backend
проблема решена: надо вставить 'useFileTransport' => true, после 'class' => 'yii\swiftmailer\Mailer',
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' => true,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.yandex.ru',
....
];
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы