Casey Bralla on 28 Nov 2009 10:08:30 -0800

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

[PLUG] Where is that Python Module??

Any Python gurus out there?

I'm writing an application that has to send eMails.    I developed it on a 
computer that runs python 2.6.4 and it works just fine.

However, when I transferred it to a Debian stable computer that runs python 
2.4.4, one of the critical modules is not loaded, and I can't figure out where 
to find it, or how to load it.  Can somebody give me some advice?

Here are some critical sections of my python code:

# Import some standard python modules
import os				# misc operating system calls.
import sys				# More misc operating system calls
import time				# sleep function
from string import *			# Use string handling routines
import smtplib				# SMTP Mail handler
from subprocess import *		# The improved subprocess funtion
from email.mime.text import MIMEText	# Needed to send eMails

# First Create the HTML message from the detail.html file
MessageFile = open(HTMLDetailFileName,"r")
eMailMessage = MIMEText(, "html")
eMailSender = ""
eMailMessage['Subject'] = "System Fail Warning"
eMailMessage['From'] = eMailSender
eMailMessage['To'] = WarnRecipient

SMTPConnection = smtplib.SMTP()
SMTPConnectionResult = SMTPConnection.connect(WarnMailServer)
SMTPConnectionResult = SMTPConnection.sendmail(eMailSender, WarnRecipient, 

When I run this program, it bombs with:
Traceback (most recent call last):
  File "./", line 40, in ?
    from email.mime.text import MIMEText        # Needed to send eMails
ImportError: No module named mime.text

OK, so I need to find the module mime.text.   Unfortunately, I can't find it 
anywhere in the Debian archives.   Anybody have a suggestion?  TIA!


Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --