S
S
Sergey2018-12-01 10:32:08
Laravel
Sergey, 2018-12-01 10:32:08

Why does Mail in Laravel always send mail to the same address?

Good day everyone!
Faced with a completely incomprehensible situation for myself. There is a project on Laravel 5.5.44. Sending an email with the following code:

Mail::send("mail.broken-links", $data, function ($message) {
    $message->from(config("mail.from.address"), config("app.name"));
    $message->to(config("mail.to.address"));
    $message->cc(config("mail.cc.address"));
    $message->subject($this->nameSubject);
});

It comes to the address indicated in the letter, but not in the copy. But more than that, if I enter any other address into the design (at least from the config, at least manually), the mail will still come to that original address (specified in ). In addition, calling from any other place in the application and substituting any address (again, even from the config, even manually), I get the same result - the letter goes only to the address . Those. no matter what I do, the letter always goes to the mailbox , it simply does not reach the copy or other recipients. In .env: , no addresses are written in .env. In config/mail.php: I cleared the config cache - , and just in caseconfig("mail.to.address")$message->toconfig("mail.to.address")Mail::sendconfig("mail.to.address")
config("mail.to.address")
MAIL_DRIVER=mail
'driver' => env('MAIL_DRIVER', 'mail')
php artisan config:cache
php artisan cache:clear, php artisan route:cache, php artisan view:clear
. Nothing helps.
Help me understand what the problem is? I understand that a poltergeist is not possible)) Most likely, the addressee is deeply cached, but how and what cache to clear is not clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vism, 2018-12-01
@SVZhidkow

The trickster was cached very deeply, into the very bowels of the documentation.
https://laravel.com/docs/5.6/mail#mail-and-local-d...
By the way, a lot of things are cached there, the cache is updated by reading the documentation :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question