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

A

a

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
 
L

Larry Bates

a said:
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
 
S

skip

py> What is the best way to construct an email in python and also attach
py> a html file
...

Check out the email package.

Skip
 
G

Grant Edwards

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

Sounds like a job for MimeWriter to me.
 
A

a

where is the link
thanks a lot for your kind help
Larry said:
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
 
A

a

hey larry thanks
Larry said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top