title: (Swift_TransportException(code: 0): Connection to tcp://server.example.com:465 Timed Out
body: <p>We have changed the email server from a provider to another. The where sending with the old email settings but not with the new ones. I am not sure if it`s laravel server or email server.</p>
  
  <p>I will use here my domain as: example.com</p>
  
  <p>I have changed the new email settings in .env:</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=server.example.com
  MAIL_PORT=465
  MAIL_USERNAME=no-reply@example.com
  MAIL_PASSWORD=secret
  MAIL_ENCRYPTION=ssl
  </code></pre>
  
  <p>and when we send emails we get this exception in laravel.log</p>
  
  <pre><code>production.ERROR: Connection to tcp://server.example.com:465 Timed Out {"exception":"[object] (Swift_TransportException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:473, Swift_IoException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:166)
  </code></pre>
  
  <p>I have tried also with tls instead of ssl but the same error.</p>
  
  <p>I have configure that email no-replay@example.com in thunderbird with the given settings from the provider and works.</p>
  
  <p>Email settings:</p>
  
  <pre><code>incoming: IMAP server.example.com 993 SSL/TLS Encrypted password 
  
  outgoing: SMTP server.example.com 465 SSL/TLS Encrypted password
  
  username (email address) and password.
  </code></pre>
  
  <p>I am missing something ????</p>