title: Using gmail smtp via Laravel: [Connection timed out #110]
body: <p>I know this question is asked many times and have different solutions and I have tried all but no one has worked. This is my settings.</p>
  <pre><code> MAIL_DRIVER=smtp
   MAIL_HOST=smtp.gmail.com
   MAIL_PORT=465
   MAIL_USERNAME=abc@mydomain.com
   MAIL_PASSWORD=mypassword
   MAIL_ENCRYPTION=ssl
  </code></pre>
  <p>And application is currently running on <code>Centos 7</code> OS.</p>
  <p>I always get</p>
  <p><code>Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [Connection timed out #110]</code></p>
  <p><code>at Swift_Transport_StreamBuffer-&gt;initialize(array('protocol' =&gt; 'ssl', 'host' =&gt; 'smtp.gmail.com', 'port' =&gt; '465', 'timeout' =&gt; '30', 'blocking' =&gt; '1', 'tls' =&gt; false, 'type' =&gt; '1', 'stream_context_options' =&gt; array())) in AbstractSmtpTransport.php line 113</code></p>
  <p>I have tried all solutions, by Replacing: <code>smtp.gmail.com with 173.194.65.108</code>, or replacing <code>smtp.gmail.com by gmail-smtp-msa.l.google.com</code>. When I do these two steps, it got server not found error.</p>
  <p>If I change mail driver from <code>smtp to sendmail or mail</code>, no error is thrown but no email is sent.</p>
  <p>If I use ip address of smtp.gmail.com, I got same result. If I change port from <code>465 to 587</code> and encryption from <code>ssl to tls</code>, nothing happens.</p>
  <p>I have also created a file in <code>etc/gai.conf</code> and put <code>precedence ::ffff:0:0/96 100</code>. It worked one time. But later after two hours, it stopped working and started throwing same error.</p>
  <p>I have also tried using my gmail id but all in vain.</p>
  <p>The only solution that I couldn't be able to test is verifying <code>httpd_can_sendmail</code> as whenever I run command <code>getsebool httpd_can_sendmail</code> I get <code>getsebool:  SELinux is disabled</code>. Is this the problem or is there any other way to get it fixed?</p>