title: symfony1 swift mailer gmail - connection refused
body: <p>I've got a symfony1 application with following factories.yml file:</p>
  
  <pre><code>  mailer:
      param:
        delivery_strategy: realtime
        transport:
          class: Swift_SmtpTransport
          param:
            host:       smtp.gmail.com
            port:       465
            encryption: ssl
            username:   my.user@gmail.com
            password:   my_password
  </code></pre>
  
  <p>password and username is correct, because I can use them to simply log in to gmail. I'm having trouble with symfony/swift mailer using gmail smtp to send mail. I'm submitting correct username/password, but google blocks, saying that the server is in Russia (giving the IP) and it says it doesn't trust it blah blah blah in case this was a security attack. Anyway, it's me and I just want to send emails using gmail.</p>
  
  <p>The original gmail warning-email is in Polish, the translated version goes like this:</p>
  
  <blockquote>
    <p>Someone recently used your password to log in to your Google Account
    my.user @ gmail.com. This person has received an
    application (such as a client e-mail) or mobile device.</p>
    
    <p>We blocked the logon attempt, in case someone wanted to break in to
    your account. Check out these information:</p>
    
    <p>Thursday, 12 December 2013 8:13:15 UTC IP address: 62.212.65.74
    (s99.linuxpl.com.) Location: Russia</p>
    
    <p>If you do not recognize the login attempts, someone else might try to
    access your account. As soon as you log in and reset your password.</p>
    
    <p>If this is you and you are having trouble accessing your account,
    follow the troubleshooting instructions available on
    <a href="http://support.google.com/mail?p=client_login" rel="nofollow">http://support.google.com/mail?p=client_login</a></p>
    
    <p>Regards, Google Accounts Team</p>
  </blockquote>
  
  <p>And the link explains how to use smtp clients just like thunderbird, but it says nothing about software like swift mailer.</p>
  
  <p>The symfony debug environment shows following error code:</p>
  
  <pre><code>Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at 
  530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 a51sm103278568eeh.8 - gsmtp 
  </code></pre>
  
  <p>Does anyone know what can I do?</p>