title: Connection could not be established with host smtp.gmail.com Laravel
body: <p>I am trying to send a mail to my email-id. I have followed all the steps that might required to send  a mail.</p>
  
  <p>But it keeps on coming 2 errors</p>
  
  <ol>
  <li><p>Connection could not be established with host smtp.gmail.com [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.#10060]</p></li>
  <li><p>Maximum execution time of 30 seconds exceeded.</p></li>
  </ol>
  
  <p>my controller is </p>
  
  <pre><code>public function contact()
      {
     Mail::send('clientinfo.contact',['name' =&gt; 'shweta'],function($message){
              $message-&gt;to('myemail@gmail.com','Some Name')-&gt;subject('Welcome!')-&gt;from('otheremail@example.com');
             });
  </code></pre>
  
  <p>mail.php file :</p>
  
  <pre><code>return [
      'driver' =&gt; env('MAIL_DRIVER', 'smtp'),
      'host' =&gt; env('MAIL_HOST', 'smtp.mailgun.org'),
      'port' =&gt; env('MAIL_PORT', 587),
      'from' =&gt; ['address' =&gt; 'someone@example.com', 'name' =&gt; 'Some  One Sender'],
      'encryption' =&gt; env('MAIL_ENCRYPTION', 'tls'),
      'username' =&gt; env('MAIL_USERNAME'),
      'password' =&gt; env('MAIL_PASSWORD'),
      'sendmail' =&gt; '/usr/sbin/sendmail -bs',
   'pretend' =&gt; false,
  
  ];
  </code></pre>
  
  <p>Please help me through this.</p>