
Message = ssage_from_file(open('message.eml'))Įxtracting Attachment Information import emailįrom emaildata.attachment import Attachmentįor content, filename, mimetype, message in Attachment.extract(message): There was module name emaildata which was available for Python 2 did the job.Įxtracting MetaData Informations import email Text = msg.get_body(preferencelist=('plain')).get_content() Msg = BytesParser(policy=fault).parse(fp) With open(file_list, 'rb') as fp: # select a specific email file from the list import emailįile_list = glob.glob('*.eml') # returns list of files With the help of the below code I am only able to extract information/ text content in the body of the email.

Also I want to download the attachments as well. I want to read text content in eml file and I want to extract meta-data information like(sender, from, cc, bcc, subject). I have an eml file with some attachments.
