title: Issue sending email with python?
body: <p>I'm trying to make an email script in python. Here's what I have (from pythonlibrary.org):</p>
  
  <pre><code>#! /usr/bin/env python
  
  import smtplib
  import string
  
  SUBJECT = "An email!"
  TO = "me@icloud.com"
  FROM = "me@gmail.com"
  text = "This text is the contents of an email!"
  BODY = string.join((
          "From: %s" % FROM,
          "To: %s" % TO,
          "Subject: %s" % SUBJECT ,
          "",
          text
          ), "\r\n")
  server = smtplib.SMTP('smtp.gmail.com')
  server.login('me@gmail.com', 'mypassword') # Not very secure, I know, but this email is dedicated to this script
  server.sendmail(FROM, [TO], BODY)
  server.quit()
  </code></pre>
  
  <p>I get <code>smtplib.SMTPException: SMTP AUTH extension not supported by server.</code> Is this is so, then why does smtp.gmail.com respond at all? Is this a problem with Gmail, or my script, or something else?</p>
  
  <p>Error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/student/Desktop/mail.py", line 18, in &lt;module&gt;
      server.login('*******@gmail.com', '**************')
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 552, in login
  smtplib.SMTPException: SMTP AUTH extension not supported by server.
  </code></pre>