Victor Subervi wrote: > Hi; > I created this testMail.py file as root: > > #!/usr/bin/env python > import smtplib > session = smtplib.SMTP("localhost") > subject = "Hello, " > header = "Subject: %s \r\nContent-type: text/html; charset=utf-8\r\n\r\n" > message = "world!" > email_from = "vic...@is.awesome" > email_to = ["em...@myhost.com <mailto:em...@myhost.com>"] > session.sendmail(email_from, email_to, header+messages) > > [r...@13gems globalsolutionsgroup.vi <http://globalsolutionsgroup.vi>]# > chmod 755 testMail.py > [r...@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 > > What gives??
Do you have a file called "email.py" in your current directory or anywhere else on Python's path outside of the standard library? If so, it's hiding the real email module from your script and you'll need to get rid of "your" email.py by renaming or moving it. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list