"Connection could not be established with host smtp.gmail.com". Symfony. Swiftmailer
<ul>
<li>I got exception:</li>
</ul>

<blockquote>
  <p>Connection could not be established with host smtp.gmail.com</p>
</blockquote>

<ul>
<li>Same exception in old project Symfony2.8 and newest Symfony3.</li>
<li>I can ping <code>smtp.gmail.com</code>.</li>
</ul>

<p><a href="https://i.stack.imgur.com/iE8zj.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/iE8zj.jpg" alt="enter image description here"></a></p>