Hello there I trying to read my email and code is :
FROM_EMAIL = "emailadd"
FROM_PWD = "pasword"
SMTP_SERVER = "imapaddress"
SMTP_PORT = 111
mail = imaplib.IMAP4_SSL(SMTP_SERVER)
mail.login(FROM_EMAIL,FROM_PWD)
mail.select('inbox')
type,data = mail.search(None, '(SUBJECT "IP")')
msgList = data[0].split()
last=msgList[len(msgList)-1]
type1,data1 = mail.fetch(last, '(RFC822)')
msg=email.message_from_string(data1[0][1])
content = msg.get_payload(decode=True)
mail.close()
mail.logout()
when I print content it will give me back as None but my email has body text anyone can help me ?