I want to retrieve body (only text) of emails using python imap and email package.
As per this SO thread, I\'m using the following code:
mail = email
The main problem in my case is that replied or forwarded message shown as message instance in the bodytext.
Solved my problem using the following code:
bodytext=mail.get_payload()[0].get_payload(); if type(bodytext) is list: bodytext=','.join(str(v) for v in bodytext)