a wrote: > What is the best way to construct an email in python and also attach a > html file
You can use 'email' package from Python's standard library to create MIME message with an attachment. > the html file to be attached is not on disk, but should be dynamically > constructed in the python script This is best handled with Django's template system: from django.template import loader, Context t = loader.get_template('email.txt') html = t.render(Context({..some data..})) > I want to attach the django debug error to an email and mail it to > myself whenever there is an error in the application In fact Django already does just this thing with DEBUG=False. It sends email with the trackback on every unhandled exception to admins listed in ADMINS in your settings. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---