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. Advertisements

  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. Advertisements

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. c# newbie
    Replies:
    3
    Views:
    6,163
  2. Guoqi Zheng

    mime multipart message

    Guoqi Zheng, May 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    669
    Guoqi Zheng
    May 22, 2004
  3. David Stockwell
    Replies:
    2
    Views:
    831
    Tim Jarman
    Jun 4, 2004
  4. Replies:
    0
    Views:
    641
  5. srinivasan srinivas
    Replies:
    1
    Views:
    432
    Justin Ezequiel
    Feb 5, 2009
  6. ecureuil
    Replies:
    0
    Views:
    619
    ecureuil
    May 28, 2006
  7. Replies:
    2
    Views:
    576
    Tintin
    Jan 5, 2007
  8. Replies:
    1
    Views:
    709
Loading...