Сколько ни копался так и не нашел причину.
Не могу отправлять почту через SMTP Пробовал через gmail и yahoo. У каждого своя проблема....
На gmail не принимает имя и пароль.
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials
Настройки самые что ни на есть стандартные
Код: Выделить всё
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com', // e.g. smtp.mandrillapp.com or smtp.gmail.com smtp.mail.yahoo.com
'username' => 'myaccount@gmail.com',
'password' => 'password',
'port' => '587', // Port 25 is a very common port too
'encryption' => 'tls', // It is often used, check your provider or mail server specs
],
],
Код: Выделить всё
\Yii::$app->mailer->compose()->setFrom('акщь@gmail.com')->setTo('ещ@gmail.com')->setSubject('Password restore')->setTextBody("Test mail send")->send();
...и да, доступ к незащищенным аппликациям в настройках джимеила давал.