title: SwiftMailer Connection could not be established with host
body: <p>I am getting an unexpected problem with emails being sent from my site. It had been working fine for some time and all of a sudden seems to have stopped for no apparent reason.</p>
  
  <blockquote>
    <p>[Swift_TransportException] exception 'Swift_TransportException' with message 'Connection could not be established with host [Connection timed out #110]' in vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:265</p>
  </blockquote>
  
  <p>In my web.php</p>
  
  <pre><code>'mailer' =&gt; [
          'class' =&gt; 'yii\swiftmailer\Mailer',
          'transport' =&gt; [
          'class' =&gt; 'Swift_SmtpTransport',
          'host' =&gt; 'mail.website.com',
          'username' =&gt; 'username',
          'password' =&gt; 'password',
          'port' =&gt; '587',
          'encryption' =&gt; 'tls',
          ],
  </code></pre>
  
  <p>What could have happened for this to stop working and how should I be fixing it?</p>
  
  <p>I am using google apps for my emails, but I have always used this config where I connect to my mail server. I'm not sure why it suddenly stopped working.</p>