Best way to construct an email - attach a html file and send

Larry Bates larry.bates at websafe.com
Wed Aug 9 09:24:29 EDT 2006


a wrote:
> What is the best way to construct an email in python and also attach a
> html file
> 
> the html file to be attached is not on disk, but should be dynamically
> constructed in the python script
> 
> I want to attach the django debug error to an email and mail it to
> myself whenever there is an error in the application
> 
> thanks a lot
> py
> 
Here is a link to a class that will allow you to attach files.  You
can either write the HTML to a tempfile and attach or modify a
little to accept a string or cstringIO object instead.  Hope it
helps.

-Larry Bates



More information about the Python-list mailing list