title: Gmail SMTP rejecting my login
body: <pre><code>smtplib.SMTPAuthenticationError: (534, '5.7.14 &lt;https://accounts.google.com/ContinueSignIn?sarp=1&amp;scc=1&amp;plt=AKgnsbvuQ\n5.7.14 hjav3RshZ9XqmApuN6mVTPJ_3AZUJEkiniSxdgdVMrgEpKpUtHi8_oCjzuOA9pkhGMyTrs\n5.7.14 fuSX9EuvWudU00Q1KXZgY4rZ1I5ZEEDOqvVMl7bOQitwyb_sYdgPA3tJC7_xpUN1zDC6Ib\n5.7.14 MjA2mM_oMdCOeCpodh-13LwLFlyzmZALwg2uu522OxG0NH74B2hafBfT2F1XK0lXCz1hce\n5.7.14 3yugD0g&gt; Please log in via your web browser and then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 bw2sm40059670pad.46 - gsmtp')
  </code></pre>
  
  <p>I am getting the above error from the below script. And yes I have verified that I am using my correct credentials. All I want to do is send an email from a script! Has anyone run into this issue before?</p>
  
  <pre><code>import smtplib
  
  FROMADDR = "my.real.address@gmail.com"
  LOGIN    = FROMADDR
  PASSWORD = "my.real.password"
  TOADDRS  = ["my.real.address@gmail.com"]
  SUBJECT  = "Test"
  
  msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n"
         % (FROMADDR, ", ".join(TOADDRS), SUBJECT) )
  msg += "some text\r\n"
  
  server = smtplib.SMTP('smtp.gmail.com', 587)
  server.set_debuglevel(1)
  server.ehlo()
  server.starttls()
  server.login(LOGIN, PASSWORD)
  server.sendmail(FROMADDR, TOADDRS, msg)
  server.quit()
  </code></pre>