title: Error Sending Email using Gmail with SMTP (Python 3)
body: <p>I am trying to use SMTP in Python 3.4 to send emails but I am receiving the following error when I run my code:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Anna Hughes/Documents/Python Projects/2015.10.16/Mail Application.py", line 9, in &lt;module&gt;
      server.login(user_email, user_password)
    File "C:\Python34\lib\smtplib.py", line 613, in login
      raise SMTPException("SMTP AUTH extension not supported by server.")
  smtplib.SMTPException: SMTP AUTH extension not supported by server.
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>import smtplib
  server = smtplib.SMTP("smtp.gmail.com:587")
  
  user_email = "user@gmail.com"
  user_password = "password"
  recipient_email = "recipient@gmail.com"
  msg = "Test."
  
  server.login(user_email, user_password)
  
  server.ehlo()
  server.starttls()
  server.sendmail(user_email, recipient_email, msg)
  server.quit()
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>I have changed the second line to <code>server = smtplib.SMTP("smpt.gmail.com, 587")</code> as suggested. That seemed to fix the error, but I am now getting a new one: </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Anna Hughes/Documents/Python Projects/2015.10.16/Mail Application.py", line 2, in &lt;module&gt;
      server = smtplib.SMTP("smtp.gmail.com,587")
    File "C:\Python34\lib\smtplib.py", line 242, in __init__
      (code, msg) = self.connect(host, port)
    File "C:\Python34\lib\smtplib.py", line 321, in connect
      self.sock = self._get_socket(host, port, self.timeout)
    File "C:\Python34\lib\smtplib.py", line 292, in _get_socket
      self.source_address)
    File "C:\Python34\lib\socket.py", line 494, in create_connection
      for res in getaddrinfo(host, port, 0, SOCK_STREAM):
    File "C:\Python34\lib\socket.py", line 533, in getaddrinfo
      for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  socket.gaierror: [Errno 11001] getaddrinfo failed
  </code></pre>