reg email packages work

P

praba kar

Dear All,

I am working in web based email system project.
Here I try to build email message
from scratch. I used below code to build email
message

msg = email.MIMEBase('text','html')
msg['Return-Path'] = user+'@'+domain
msg['Date'] = formatdate(localtime=1)
msg['Subject'] = subject
msg['From'] = from_name
msg['To'] = to
msg['Cc'] = cc
msg.set_payload("Body of the email messagge")
fh = os.popen('/bin/sendmail %s'% (eachid),'w')
fh.write(msg.as_string())
fh.close()

This code will build plain email message properly.
But after building the message. If a email user
download this mail through out look express then
this email message will display without any alignment.
If a user type 3 paragraph message
outlook express display as a single line. What
could be problem?. Kindly let me know ASAP

regards
Prabahar



__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
 
T

Tim Roberts

praba kar said:
I am working in web based email system project.
Here I try to build email message
from scratch. I used below code to build email
message

msg = email.MIMEBase('text','html')
msg['Return-Path'] = user+'@'+domain
msg['Date'] = formatdate(localtime=1)
msg['Subject'] = subject
msg['From'] = from_name
msg['To'] = to
msg['Cc'] = cc
msg.set_payload("Body of the email messagge")
fh = os.popen('/bin/sendmail %s'% (eachid),'w')
fh.write(msg.as_string())
fh.close()

This code will build plain email message properly.

No, it doesn't. It builds an HTML message (see the very first line). If
you supply plain text to this as the body of the message, all the lines
will be concatenated together, which sounds a lot like what you are seeing.

If you are not feeding HTML as the body, change the fist line to
('text','plain').
 

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

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top