title: Swiftmailer: Connection could not be established with host smtp.gmail.com [Connection timed out #110]
body: <p>I'm posting because I've already gone through the solutions posted in other questions on here but they haven't helped.</p>
  
  <p>What I am trying to do is send email using Swiftmailer through Google Apps for Business Gmail but I keep getting this error:</p>
  
  <blockquote>
    <p>Connection could not be established with host smtp.gmail.com [Connection timed out #110]</p>
  </blockquote>
  
  <p>I know the code is fine because it works on my local machine but not on the production server.</p>
  
  <p>What I have tried so far:</p>
  
  <ul>
  <li>Enabled OpenSSL.</li>
  <li>Unblocked account from Google captcha.</li>
  <li>Used an Application Specific Password.</li>
  <li>Whitelisted Gmail SMTP IP addresses</li>
  </ul>
  
  <p>Configuration:</p>
  
  <pre><code># Swiftmailer Configuration
  swiftmailer:
      transport:  smtp
      encryption: ssl
      auth_mode:  login
      host:       smtp.gmail.com
      username:   contact@mydomain.com
      password:   applicationspecificpassword
      port:       465
  </code></pre>
  
  <p>What else can I try? Could this be a DNS issue since I am using Gmails SMTP MX records instead of the servers.</p>