osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package


   Just registered?
   Thanks

     -------- Original Message --------
     Subject: ModuleNotFoundError: No module named 'email.mime'; 'email' is
     not a package
     From: <[1]bob at bbhoyer.com>
     Date: Sun, December 08, 2019 11:14 am
     To: [2]python-list at python.org

     Hello Python Team,?
     I am a beginner in Python, been working on class material from Mosh
     youtube 6 hrs., Mosh 12 hr paid course; Python Cash Course by Eric
     Matthes? ? most of the time everything works just fine or a little
     adjustment for updated versions.
     I am running Python 3.8.0?
     In example, Mosh 12 hr course, he did an exercise on sending email from
     within Python, so here is the code :
     from?email.mime.multipart?import?MIMEMultipart
     from?email.mime.text?import?MIMEText
     import?smtplib
     message?=?MIMEMultipart()
     message["from"]?=?"Bob?Hoyer?=?Python"
     message["to"]?=?"[3]bob at bbhoyer.com"
     message["subject"]?=?"This?is?a?test?using?Python"
     message.attach(MIMEText("Body"))
     #?godaddy?recommended?SMTP_SSL,?host?name?&?port?#
     with?smtplib.SMTP(host="smtpout.secureserver.net",?port=465)?as?smtp:
     ????smtp.ehlo()
     ????#?godaddy?recommended?removing?...
     ????#?smtp.starttls()
     ????smtp.login("[4]email at email.com",?"password")? #email login &
     password blanked out for this msg
     ????smtp.send_message(message)
     ????print("Sent?...")
     smtp.close()
     Here is the error message:?
     Traceback?(most?recent?call?last):
     ??File?"c:\Users\Owner\Desktop\HelloWorld\[5]email.py",?line?1,?in?<module>
     ????from?email.mime.multipart?import?MIMEMultipart
     ??File?"c:\Users\Owner\Desktop\HelloWorld\[6]email.py",?line?1,?in?<module>
     ????from?email.mime.multipart?import?MIMEMultipart
     ModuleNotFoundError:?No?module?named?'email.mime';?'email'?is?not?a?package
     I have spent some time trying to figure out resolve ...
     Can you help me with this pistol of a problem ??
     Bob Hoyer

References

   Visible links
   1. mailto:bob at bbhoyer.com
   2. mailto:python-list at python.org
   3. mailto:bob at bbhoyer.com
   4. mailto:email at email.com
   5. http://email.py/
   6. http://email.py/