S
S
Sergey2019-09-21 21:16:07
SMTP
Sergey, 2019-09-21 21:16:07

Why can't emails be sent via SMTP Laravel from under Cron?

Good afternoon. There is a multi-domain site on Laravel. When sending mail, from users (non-console version) - everything works fine. in AppServiceProvider added mail configuration setting depending on the site.

config([
                'mail' => [
                    'driver' => 'smtp',
                    'host' => 'smtp.yandex.com',
                    'username' => $site->senderEmail,
                    'password' => $site->senderPassword,
                    'encryption' => 'tls',
                    'port' => '587',
                ],
            ]);

But the letters that are sent from schedule by cron are not sent.
553 Error 5.7.1 Sender address rejected: not owned
by auth user how to see under whom it is really authorized, I can’t guess in any way).
At first I thought it was the domain. because the HELO command sent with the domain 127.0.0.1. corrected - did not help.
Where else can you dig?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2019-09-23
@felmist

I don't know what the hell. helped changing the settings to
smtp.yandex. ru
ssl
465
At the same time, I added the config just before sending.

A
Andrey Gavrilov, 2019-09-21
@thexaver

"Sender address rejected: not owned by auth user"
This means:
"The sender address is rejected because it does not belong to the specified user"
You need to specify in the sender the address of the real mailbox on the bound domain for which you specify the login-password:
$mail ->From = "[email protected]";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question