You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now when I send mail with Mail::send(), it works just fine and uses the server I set. But when using Mail::queue() or Mail::later(), it instead tries to use the default SMTP settings from app/config/mail.php.
Is there a workaround this? I took a look in src/Illuminate/Mail/Message.php but there was no function to attach SMTP info into the Mail::queue() call which would have worked in this situation.
The text was updated successfully, but these errors were encountered:
Don't set config on demand is the sollution. Otherwise, your solution would be to create a custom mailer instance, serialize it, and send it with your own custom queue job, or probably, more reliably, pass the config with your own custom queue job, then create a mailer at the other end from the config.
The config won't persist past the current request. Alternatively use Queue::push and use a custom job that calls Mail::send and set the config in THAT job.
I set SMTP server on-the-fly with:
Now when I send mail with
Mail::send()
, it works just fine and uses the server I set.But when using
Mail::queue()
orMail::later()
, it instead tries to use the default SMTP settings from app/config/mail.php.Is there a workaround this? I took a look in src/Illuminate/Mail/Message.php but there was no function to attach SMTP info into the
Mail::queue()
call which would have worked in this situation.The text was updated successfully, but these errors were encountered: