title: New to Python, GMail SMTP error
body: <p>I am writing a simple sendmail function to myself and I keep getting this error:</p>
  
  <p>NameError: name 'SMTPException' is not defined</p>
  
  <p>What is wrong with my code? Any suggestions?</p>
  
  <pre><code>import smtplib
  
  sender = "user@gmail.com"
  receiver = ["user@gmail.com"]
  message = "Hello!"
  
  try:
      session = smptlib.SMTP('smtp.gmail.com',587)
      session.ehlo()
      session.starttls()
      session.ehlo()
      session.login(sender,'password')
      session.sendmail(sender,receiver,message)
      session.quit()
  except SMTPException:
      print('Error')
  </code></pre>