Python Will Not Send Email!!

Carsten Haese carsten.haese at gmail.com
Fri Nov 20 11:38:42 EST 2009


Victor Subervi wrote:
> On Fri, Nov 20, 2009 at 11:14 AM, Carsten Haese <carsten.haese at gmail.com
> <mailto:carsten.haese at gmail.com>> wrote: 
>     Please show us a copy-and-paste of your command line window contents
>     that result from executing <<python testMail.py>> and then executing
>     <<python -c "import email; print email">> immediately thereafter.
> 
> 
> [root at 13gems globalsolutionsgroup.vi <http://globalsolutionsgroup.vi>]#
> python testMail.py
> Traceback (most recent call last):
>   File "testMail.py", line 2, in ?
>     import smtplib
>   File "/usr/lib64/python2.4/smtplib.py", line 49, in ?
>     from email.base64MIME import encode as encode_base64
> ImportError: No module named base64MIME
> [root at 13gems globalsolutionsgroup.vi <http://globalsolutionsgroup.vi>]#
> python -c "import email; print email"
> <module 'email' from 'email.pyc'>

Thank you. This proves conclusively that there IS in fact a file called
email.pyc (and/or email.py) in your directory next to testMail.py. It is
this email.pyc that is being imported instead of the email.py from the
Python library. Getting rid of both email.py and email.pyc (by renaming
them, deleting them, or moving them somewhere else) will fix your problem.

--
Carsten Haese
http://informixdb.sourceforge.net




More information about the Python-list mailing list