I'm trying to print the email body of all the emails from an specific sender, when I run the code I when an output of lines of this 5H6ONzrsveoHzDAKli/
and more random letters and signs. Here is the whole code. Thankyou
import imaplib
import pprint
imap_host = 'imap.gmail.com'
imap_user = 'user@googlemail.com'
imap_pass = 'password'
# connect to host using SSL
imap = imaplib.IMAP4_SSL(imap_host)
## login to server
imap.login(imap_user, imap_pass)
imap.select('Inbox')
tmp, data = imap.search(None, '(FROM "specific@gmail.com")')
for num in data[0].split():
tmp, data = imap.fetch(num, '(RFC822)')
#print('Message: {0}\n'.format(num))
pprint.pprint(data[0][1])
break
imap.close()