from imaplib import IMAP4_SSL
M = IMAP4_SSL(hostName, port)
M.login(emailID, emailPassword)
M.select('Inbox')
msgNums = '101,102' # Assume we need data from these 2 emails
# typ, messages = box.fetch(msgNums, '(RFC822)')
# typ, messages = box.fetch(msgNums, '(UID BODY[HEADER])')
typ, messages = box.fetch(msgNums, '(UID BODY[TEXT])')
I've only been able to find the three codes [(RFC822)
, (UID BODY[HEADER])
, and (UID BODY[TEXT])
].
Is there a full list of tags I can use?