title: Connection could not be established when sending swiftmailer email through symfony2
body: <p>Every time I try to send an email through a google apps account with swiftmailer in symfony 2.3.11, I get the following message</p>
  
  <blockquote>
    <p>Connection could not be established with host smtp.gmail.com
    [php_network_getaddresses: getaddrinfo failed: Temporary failure in
    name resolution #0] 500 Internal Server Error -
    Swift_TransportException</p>
  </blockquote>
  
  <p>I googled it but I didn't get any results so I must be doing something wrong.</p>
  
  <p>config.yml</p>
  
  <pre><code># Swiftmailer Configuraftion swiftmailer:
      transport:  gmail
      username:   info@*******.com
      password:   **
  </code></pre>
  
  <p>Controller that sends email :</p>
  
  <pre><code>/* send an email to user */
  $message = \Swift_Message::newInstance()
      -&gt;setSubject('Thank you')
      -&gt;setFrom('info@********.com')
      -&gt;setTo($email)
      -&gt;setBody(
      $this-&gt;renderView(
          'xyProfileBundle:Mailer:thankyou.html.twig', 
          array('email' =&gt; $email, 'token' =&gt; $token)
          )
      )
      -&gt;setContentType("text/html");
  $this-&gt;get('mailer')-&gt;send($message);
  </code></pre>
  
  <p>How can I fix this? </p>