S
S
Stanislav Pochepko2015-10-01 14:31:30
Yandex
Stanislav Pochepko, 2015-10-01 14:31:30

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

File app/config/mail.php
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

6 answer(s)
D
Danil, 2016-09-22
@danleks

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'),

The settings for sending with Gmail are similar.

D
dogivberlogi, 2018-10-30
@ImproveAl

I had a mistake
The whole problem was that it did not enter the freshly created mailbox (did not complete the registration).

K
Konstantin Eliseev, 2018-08-24
@K0r5hun

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

Then, in the console, the
AND command, just in case, rebooted the server ... Although most likely it was not necessary.

V
Vlad Tokarev, 2015-10-01
@Vadiok

Login scores in the form "[email protected]" or just "your_login"? Correct with "@yandex.ru"

U
UksusoFF, 2017-05-30
@UksusoFF

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.

A
Azamat S, 2021-03-24
@Izek_it

Guys, close this topic, it's easy to solve, remove the smtp prefix.

MAIL_MAILER=smtp
MAIL_HOST=yandex.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question