Created
October 26, 2015 18:17
-
-
Save kmila/f91fa08c84fa25128985 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imaplib | |
M = imaplib.IMAP4_SSL('imap.oi.com.br') | |
if (M.login('<USER_TO_TEST>@oi.com.br','PASSWORD')[0] != 'OK'): exit("no conn") | |
c = (M.select('Inbox'))[1][0] | |
if (c != '0'):print c | |
typ, data = M.search(None, '(SEEN)') | |
for num in data[0].split(): | |
typ, data = M.fetch(num, '(RFC822)') | |
print('Message %s\n%s\n' % (num, data[0][1])) | |
M.shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment