Answer the question
In order to leave comments, you need to log in
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',
],
]);
Answer the question
In order to leave comments, you need to log in
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.
"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 questionAsk a Question
731 491 924 answers to any question