title: Python Google App Engine : Send Mail Error
body: <p>I am writing a simple test application to send email using Python GAE. I am receiving below error in logs. I have tried empty body and other changes but nothing seems to be working. Is there any configuration changes that I need to make?</p>
  
  <p>Traceback (most recent call last):</p>
  
  <p>&nbsp;&nbsp; File "/base/data/home/apps/s~xxxx/1.360190002979488583/email.py", line 5, in <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from google.appengine.api import mail
    File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/mail.py", line 37, in  <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from email import MIMEBase <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ImportError: cannot import name MIMEBase</p>
  
  <p>Below is my app.yaml file</p>
  
  <pre><code>application: mailer
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: no
  
  handlers:
  - url: /email
    script: email.py
  
  libraries:
  - name: webapp2
    version: "2.5.1"
  </code></pre>
  
  <p>Below is my email.py (essentially it is the same code as mentioned on <a href="https://developers.google.com/appengine/docs/python/mail/sendingmail" rel="nofollow">https://developers.google.com/appengine/docs/python/mail/sendingmail</a> . I have just changed from and to a valid email address)</p>
  
  <pre><code>from google.appengine.api import mail
  import sys
  
  message = mail.EmailMessage(sender="Example.com Support &lt;valid-from-address@gmail.com&gt;",
                              subject="Your account has been approved")
  
  message.to = "Valid User &lt;valid.user@gmail.com&gt;"
  message.body = """
  Dear Albert:
  
  Your example.com account has been approved.  
  
  The example.com Team
  """
  
  message.send()
  </code></pre>