Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:38:12+00:00 2026-06-04T05:38:12+00:00

I am attempting to get the body of an email message using message.get_payload(). However,

  • 0

I am attempting to get the body of an email message using message.get_payload().

However, this only retrieves the text content of the email, even though the original message is in HTML (i.e. properly displayed in my mail client). How can I retrieve the full HTML content of the message?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:38:13+00:00Added an answer on June 4, 2026 at 5:38 am

    From the documentation

    get_payload([i[, decode]]) 
        Return the current payload, which will be a list of Message objects when 
        is_multipart() is True, or a string when is_multipart() is False.
    
        With optional argument i, get_payload() will return the i-th element of 
        the payload, counting from zero, if is_multipart() is True.
    

    Usually HTML email is sent as MIME message. There is often a text only copy and a HTML copy. Have you check how many parts you messages has and if you’ve tried to retrieve other parts?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im attempting to get a block of text from a file I have already
I´ve been attempting to get a polar plotting in a PolarChart using MSchart, and
I'm attempting to get order data from a Yahoo store. I'm using the docs
I am attempting to generate the body of an email in Outlook 2007 from
I'm attempting to get the height of an element using jQuery, but am receiving
I am attempting to layout a site: http://kenzshop.com/Brandon/index I cannot get the main content
I've currently got an issue. I'm attempting to format a block of text using
I am attempting to implement the suckerfish menu found on this tutorial. I get
Attempting to get Spring internationalization working. I have used classpath:messages basename, created .properties files
I'm attempting to get rid of an app's HTML files and store their contents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.