Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > re: howto send html mails using smtplib

Reply
Thread Tools

re: howto send html mails using smtplib

 
 
Tim Williams
Guest
Posts: n/a
 
      06-10-2005
"Philippe C. Martin" <(E-Mail Removed)> wrote in message
news:sD3qe.2270$(E-Mail Removed) m...
> I have the following problem:
> 1) I can use smtplib to send text messages
> 2) I can generate html
> 3) I want to email the html and want it to be seen by the email client as
> html.
>
> However, when I receive the message, the email client displays it as text
> (code hereunder) - I assume it has to do with the MIMEText call but since

I
> cannot see any MIMEhtml .....



I suspect you need one of the following lines.

msg.replace_header('Content-Type', 'text/html')

msg.add_header('Content-Type', 'text/html')


HTH

--

=================================
Tim Williams


 
Reply With Quote
 
 
 
 
Philippe C. Martin
Guest
Posts: n/a
 
      06-10-2005
Tim,

You are most correct, replace_header did the trick.

Thanks a bunch.


Philippe



Tim Williams wrote:

> "Philippe C. Martin" <(E-Mail Removed)> wrote in message
> news:sD3qe.2270$(E-Mail Removed) m...
>> I have the following problem:
>> 1) I can use smtplib to send text messages
>> 2) I can generate html
>> 3) I want to email the html and want it to be seen by the email client as
>> html.
>>
>> However, when I receive the message, the email client displays it as text
>> (code hereunder) - I assume it has to do with the MIMEText call but since

> I
>> cannot see any MIMEhtml .....

>
>
> I suspect you need one of the following lines.
>
> msg.replace_header('Content-Type', 'text/html')
>
> msg.add_header('Content-Type', 'text/html')
>
>
> HTH
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: smtplib send email by using gmail smtp server Gabriel Genellina Python 0 05-03-2009 06:08 PM
[SMTPLIB] how to send a "Multiline" mail with smtplib? Evan Python 3 06-23-2008 08:50 AM
howto send html mails using smtplib Philippe C. Martin Python 0 06-09-2005 10:44 PM
converting Mozilla mails into Outlook Express mails Martin Geers Firefox 1 07-17-2004 01:11 AM
e-mails going to a black hole, or companies that don't reply e-mails Mauricio Freitas NZ Computing 5 02-10-2004 01:21 AM



Advertisments