title: Python Error email.mime has no attribute 'MIMEMultipart'
body: <p>I am writing a project to use a Raspberry Pi 3 to send an email through Gmail. The project works great on my laptop but when I try to run the code on the Raspberry Pi the following error keeps getting reported:</p>
  
  <pre><code>email.mime has no attribute 'MIMEMultipart'
  </code></pre>
  
  <p>I have tried to re-install the email package using pip-install as suggested elsewhere, but it has not fixed the issue.  I am especially perplexed as this currently works on my laptop, but will not work on the Raspberry Pi 3.</p>
  
  <p>My code is below:</p>
  
  <pre><code>import smtplib
  import mimetypes
  import email
  import email.mime.application
  
  FROM = "Sender's address" #This has been removed from this post, but normally contains sender's address
  TO = "recipient's address" #This has been removed from this post, but normally contains recipient's address
  
  msg = email.mime.Multipart.MIMEMultipart()
  msg['Subject'] = 'Greetings'
  msg['From'] = FROM
  msg['To'] = TO
  
  
  body = email.mime.Text.MIMEText("""hi""")
  msg.attach(body)
  
  
  filename= "path+filename" #e.g.(C:/Users/Pictures/pic.jpg)
  fp=open(filename,'rb')
  att = email.mime.application.MIMEApplication(fp.read(),_subtype="jpg")
  fp.close()
  att.add_header('Content-Disposition','attachment',filename=filename)
  msg.attach(att)
  
  s = smtplib.SMTP('smtp.gmail.com',587)
  s.starttls()
  s.login('FROM','PASSWORD') #password is actually entered here in my real code, it has been removed from this post
  s.sendmail('FROM',['TO'], 
  msg.as_string())
  s.quit()
  </code></pre>
  
  <p>Thank you in advance for any guidance you can provide.</p>