Answer the question
In order to leave comments, you need to log in
How to use smtp.yandex.ru in laravel?
Good afternoon. Tell me what I'm doing wrong.
Trying to set up smtp yandex in laravel project, but I get
"Swift_TransportException in AbstractSmtpTransport.php" line 383:
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required
"
MAIL_DRIVER=smtp
MAIL_HOST=smtp.yandex.ru
MAIL_PORT=465
MAIL_USERNAME={login}
MAIL_PASSWORD={password}
MAIL_ENCRYPTION=ssl
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.yandex.ru'),
'port' => env('MAIL_PORT', 465),
'from' => ['address' => "{myAddress}", 'name' => "{From}"],
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
'username' => env('MAIL_USERNAME',),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
Answer the question
In order to leave comments, you need to log in
I also suffered for a long time.
Decided the next day radically.
Sawed out all Mail-settings from .env
And entered the following into config/mail.php:
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.yandex.ru'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => '[email protected]',
'name' => 'Type What You Want',
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME', '[email protected]'),
'password' => env('MAIL_PASSWORD', 'secretpass'),
I had a mistake
The whole problem was that it did not enter the freshly created mailbox (did not complete the registration).
The same problem was. I give the full config in the .env file for mail:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.yandex.ru
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=ПАРОЛЬ
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=Vacanc
Login scores in the form "[email protected]" or just "your_login"? Correct with "@yandex.ru"
It turns out that now Yandex still may not send letters from "suspicious" accounts.
I struggled with the settings for half a day, as a result I wrote to the support, to which I received an answer:
This problem is caused by the fact that the registration of your login seemed suspicious to our security system.
In order to fix the problem with sending and receiving emails, you must provide valid personal data on the https://passport.yandex.ru/passport?mode=passport page. In the same place, you will need to bind a mobile phone (link "phone numbers"), if you have not already done so, and, if a captcha (control characters) request appears, enter it. After that, the blocking will be removed automatically.
Please note that it will take several hours to remove the lock - during this time the system should receive and remember the changes you made.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question