How do i add body to 'email.mime.multipart.MIMEMultipart' instance?

Discussion in 'Python' started by srinivasan srinivas, Feb 4, 2009.

  1. Hi,
    Could someone tell me the way to add body content to 'email.mime.multipart.MIMEMultipart' instance?

    Thanks,
    Srini


    Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
     
    srinivasan srinivas, Feb 4, 2009
    #1
    1. Advertising

  2. Re: How do i add body to 'email.mime.multipart.MIMEMultipart'instance?

    On Feb 4, 2:50 pm, srinivasan srinivas <>
    wrote:
    > Hi,
    > Could someone tell me the way to add body content to 'email.mime.multipart.MIMEMultipart' instance?
    >
    > Thanks,
    > Srini


    excerpt from one of the modules I use:

    def build_body(html, text=''):
    text = text.strip() and text or html2text(html).encode('ascii',
    'xmlcharrefreplace')
    body = MIMEMultipart('alternative')
    body.attach(MIMEText(text))
    body.attach(MIMEText(html, 'html'))
    return body

    HTH

    Justin
     
    Justin Ezequiel, Feb 4, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Stockwell
    Replies:
    2
    Views:
    732
    Tim Jarman
    Jun 4, 2004
  2. Replies:
    0
    Views:
    558
  3. srinivasan srinivas
    Replies:
    1
    Views:
    338
    Justin Ezequiel
    Feb 5, 2009
  4. ecureuil
    Replies:
    0
    Views:
    361
    ecureuil
    May 28, 2006
  5. Replies:
    1
    Views:
    464
Loading...

Share This Page