Forums

import email.mime # fail

Hi

I'm trying to send an email by using the smtp also I need a Mimetext so I'm using the following:

from email.mime import text

But it failed.

13:41 ~/sgsst/scripts $ python3 email.py Traceback (most recent call last): File "email.py", line 2, in <module> import email.mime File "/home/selobu/sgsst/scripts/email.py", line 2, in <module> import email.mime ImportError: No module named 'email.mime'; 'email' is not a package 13:41 ~/sgsst/scripts $

i think the name of your file (email.py) is conflicting with the built-in email package, so that's why it can't import. Try renaming the file to something else?

You're rigth thanks

:)