Laravel Dynamic Mailserver [Laravel 6.2]

  laravel, laravel-6, php

im currently trying to figure out, how to conditionally change the mailserver.
The Mail is a Notification, which gets send via the queue worker.
I tried multiple approaches such as: Setting the Config dynamically with Config::set, using a Middleware and removing the MailserviceProvider etc.
But the Mail still gets send out via the mailserver that is set in the .env.
I debugged the whole Job until it finishes, and it still had the mailserver which i set dynamically (Checked via Config::get('mail')). But it still gets not send out with this one.

I hope you can help me, thanks!

Source: Laravel

Leave a Reply