473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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

Aug 9 '06 #1
6 2515
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
Aug 9 '06 #2

pyWhat is the best way to construct an email in python and also attach
pya html file
...

Check out the email package.

Skip
Aug 9 '06 #3
On 2006-08-09, a <a@tempinbox.comwrote:
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.

--
Grant Edwards grante Yow! BEEP-BEEP!! I'm a
at '49 STUDEBAKER!!
visi.com
Aug 9 '06 #4
a
where is the link
thanks a lot for your kind help
Larry Bates wrote:
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
Aug 13 '06 #5
a wrote:
where is the link
thanks a lot for your kind help
Larry Bates wrote:
>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
Sorry, Left off the link:

http://motion.sourceforge.net/related/send_jpg.py
Aug 23 '06 #6
a
hey larry thanks
Larry Bates wrote:
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
Aug 23 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: tabonni | last post by:
Hi I try to grab the checked files from HTML page and then send those PDF files as attachments. It can just send email, there are no PDF files attached. Can anybody point out my error? My...
6
by: NetNoise | last post by:
Hi. I'm using CDO SYS to send email messages. I can attach a file just fine. However, I need to attach an HTML page that's generated on the fly by my ASP code. The attachment source code gets...
3
by: Erik Johnson | last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an attached HTML file. I have scripts that send basic emails via the smtplib module that don't have any attachements and that...
1
nirmalsingh
by: nirmalsingh | last post by:
hi everybody, my code for sending email is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title>...
3
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi There, I use follow code to send email inside VB.NET 2005. It does not work well. Error message of "Failure sending email" would occue. However, email was sent out sometimes. I am confused...
6
by: ssankar | last post by:
hi all - I have been tasked to send customized emails to a set of users based on a certain condition in my company. ( This is NOT SPAM ) I have used MIME::Lite successfully to send html...
1
by: budyerr | last post by:
All, I am trying to build a email submission form using asp.net. I currently have a web form page that will upload to my webhosting server, attach to email then delete the file after sending. ...
3
by: jambonjamasb | last post by:
Hi I have two tables: email_tbl Data_table Data table is is used to create a Form Data_form
14
by: sreemathy2000 | last post by:
My requirement is to generate and attach a file and send in an email automatically. i have a existing functionality where i using the code below to write a CSV file in my local system. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.