I have an .mbox
file that represents many messages at location mbox_fname
. In Python 3, I have already loaded each of the messages, which are objects of the class email.message.Message
.
I'd like to get access to the body content of the message.
For instance, something like:
import mailbox
the_mailbox = mailbox.mbox(mbox_fname)
for message in the_mailbox:
subject = message["subject"]
content = <???>
How do I access the body of the message?