V
V
Vadim Nadzharov2016-03-17 13:07:31
Yandex
Vadim Nadzharov, 2016-03-17 13:07:31

How to set up Laravel and Yandex smtp (mail for domains)?

The following options are available:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.yandex.ru
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=user_password
MAIL_ENCRYPTION=ssl

When trying to send a message, the following error occurs:
503 5.5.4 Error: send AUTH command first.

I suspect that Swiftmailer also needs to pass the auth_mode = login parameter.
But how to do this if this parameter is not in the Laravel configuration file?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
P
Philip Fedorov, 2018-09-20
@svazist

It is necessary in the account settings, on Yandex (Yanex Passport):
1. fill in personal information
2. In the "Passwords and authorization" block there is an "Application passwords" block and the "Create another one" link - create a new password there and use it in the Laravel config

D
Danil, 2016-09-22
@danleks

I also suffered for a long time. The answer above didn't help.
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.

A
Andrzej Wielski, 2016-03-17
@wielski

MAIL_PORT=465

Try 587
try tls

P
Piligrim, 2018-07-24
@Shkuta85

There was the same problem. The issue was resolved by adding the following lines to .env:
[email protected]
MAIL_FROM_NAME=Sender_Name

K
Konstantin Eliseev, 2018-08-24
@K0r5hun

The same problem was. I decided as written above, I give the full config in the .env file:

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.

N
nikorus, 2018-10-09
@nikorus

Thank you ! And then they scored the whole Google with all sorts of cleverness

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question