title: How can I change SMTP details globally at runtime?
body: <p>I'm using Laravel 5.5.  The nature of the website is a 'multisite' architecture where multiple websites/domains are run from the same codebase.</p>
  
  <p>I've come across an issue when sending email.  I need to change the <code>from</code> <code>name</code> and <code>address</code> as well as the <code>transport</code> (SMTP, etc) options depending on which website is being viewed.  I have these details stored in a config file.</p>
  
  <p>The easiest way is to just pull those details in the Controller before I call <code>Mail::send</code>/<code>Mail::queue</code> and to update them.  However, this brings back 2 issues:</p>
  
  <ol>
  <li>There is a heavy reliance on remembering to actually do that every time I send any email in the code.  In short, it's not abiding by DRY.</li>
  <li>I'd be forced to use <code>Mail::send</code> instead of <code>Mail::queue</code>, because the queue wouldn't have any idea of the config update from the time it was <strong><em>queued</em></strong> only from when it is <strong><em>processed</em></strong> .</li>
  </ol>
  
  <p>How can I achieve what I am looking to do here in a clean way?</p>
  
  <p>I thought about extending all of my 'Mailable' classes with a custom class that updates the SMTP details, but it doesn't look like you can update the SMTP/Transport information after the class is initiated; you can only update the <code>from</code> <code>name</code> and <code>address</code>.</p>