Python Will Not Send Email!!

Kev Dwyer kevin.p.dwyer at gmail.com
Fri Nov 20 16:05:38 CET 2009


On Fri, 20 Nov 2009 07:58:55 -0500, Victor Subervi wrote:

> On Thu, Nov 19, 2009 at 5:01 PM, Kev Dwyer <kevin.p.dwyer at gmail.com>
> wrote:
> 
>> On Thu, 19 Nov 2009 11:28:37 -0400, Victor Subervi wrote:
>>
>> Hello Victor,
>>
>> There are some pages on the internet that suggest that this problem my
>> be caused by a module named email.py (or email.pyc) in your pythonpath.
>>  If you try import smtplib in the interpreter do you get this error
>> message? If so, start a new interpreter session and try import email -
>> is the email module imported from the stdlib?
>>
>>
> Both of these import just fine.
> 
> 
>> If these steps don't help, it might be useful if you can tell us which
>> Linux distribution you are using.
>>
>>
> Python 2.4.3
> [root at 13gems ~]# uname -a
> Linux 13gems.com.13gems.com 2.6.18-028stab064.8 #1 SMP Fri Nov 6
> 11:28:25 MSK 2009 x86_64 x86_64 x86_64 GNU/Linux CentOS 5.4 final
> TIA,
> V
> <div class="gmail_quote">On Thu, Nov 19, 2009 at 5:01 PM, Kev Dwyer
> <span dir="ltr"><<a
> href="mailto:kevin.p.dwyer at gmail.com">kevin.p.dwyer at gmail.com</a>></
span>
> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0
> .8ex;border-left:1px #ccc solid;padding-left:1ex;"> On Thu, 19 Nov 2009
> 11:28:37 -0400, Victor Subervi wrote:<br> <br>
> Hello Victor,<br>
> <br>
> There are some pages on the internet that suggest that this problem my
> be<br> caused by a module named email.py (or email.pyc) in your
> pythonpath.  If<br> you try import smtplib in the interpreter do you get
> this error message?<br> If so, start a new interpreter session and try
> import email - is the<br> email module imported from the
> stdlib?<br></blockquote><div><br></div><div>Both of these import just
> fine. </div><blockquote class="gmail_quote" style="margin:0 0 0
> .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br>
> If these steps don't help, it might be useful if you can tell us
> which<br> Linux distribution you are
> using.<br></blockquote><div><br></div><div>Python
> 2.4.3</div><div><div>[root at 13gems ~]# uname -a</div><div>Linux <a
> href="http://13gems.com.13gems.com">13gems.com.13gems.com</a>
> 2.6.18-028stab064.8 #1 SMP Fri Nov 6 11:28:25 MSK 2009 x86_64 x86_64
> x86_64 GNU/Linux</div> <div>CentOS 5.4
> final</div><div>TIA,</div><div>V</div></div></div>

Hello Victor,

I ran your script on a CentOS vm (5.2 server 32bit, not quite the same as 
yours but also running python 2.4.3).  It ran without error.  So I 
suspect that either you have a rogue email module/package on your machine 
or there's something wrong with the python install.

You could try:

import email
email.__version__

My interpreter responds "3.0.1"  If you get a different response that 
suggests a dodgy module somewhere - try email.__file__ and see where it's 
located (my interpreter returns /usr/lib/python2.4/email/__init__.pyc).

If the version number is "3.0.1" on your machine then I would check the 
contents of /usr/lib64/python2.4/email/.  Perhaps the base64MIME module 
is missing.

Cheers,

Kev




More information about the Python-list mailing list