title: Script Sending mails with Gmail: Failed to authenticate on SMTP server
body: <p>I am having some hard time getting my PHP script  to send emails with a SMTP Gmail account. I am using PHP and Symfony2 SwiftMailer, but it seems that the problem lies with my Gmail account configuration. In my logs, I end up with the following error message:</p>
  
  <pre><code>"ERROR - Exception occurred while flushing email queue: Failed to authenticate on SMTP server with username "new.user.name@gmail.com" using 1 possible authenticators"
  </code></pre>
  
  <p>Luckily, I had another Gmail account working with another application, seemlessly. Rescuing these parameters (user and password) on my new box, eveything works just fine.</p>
  
  <p>in parameters.yml I have (working fine):</p>
  
  <pre><code>parameters:
      mailer_transport: gmail
      mailer_host: ~
      mailer_user: old.user.account@gmail.com
      mailer_password: old-password
  </code></pre>
  
  <p>And here is the version giving auth error message:</p>
  
  <pre><code>parameters:
      mailer_transport: gmail
      mailer_host: ~
      mailer_user: new.user.account@gmail.com
      mailer_password: new-password
  </code></pre>
  
  <p>Needless to say I have checked, rechecked and checked yet again user and password.</p>
  
  <p>I reviewed my Gmail account settings under "Forwarding and POP/IMAP" in my new account: I could find nothing about SMTP.</p>
  
  <p>Searches made me aware some captcha policy may interfere with SMTP accounts. I read <a href="https://stackoverflow.com/questions/1607828/how-to-use-Gmail-as-a-free-smtp-server-and-overcome-captcha">here</a> that I should try to enter a captcha phrase, which I do <a href="https://accounts.google.com/DisplayUnlockCaptcha" rel="noreferrer">here</a>, and get the nice message:"Account access enabled", "Please try signing in to your Google account again from your new device or application."</p>
  
  <p>Trying again. No luck.</p>
  
  <p>All this is happening from my local dev environment (both OK mails, and NOT OK mails).</p>
  
  <p>How I could get to use SMTP with a newly created Gmail Account ? Any idea ? </p>