Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import getpass, imaplib
- #your mail id = type your mail id
- #your password = type ypur password
- username = 'your mail id'
- password = 'your password'
- M = imaplib.IMAP4_SSL('IMAP.gmail.com',993)
- M.login(username, password)
- M.select()
- typ, data = M.search(None, 'UNSEEN')
- for num in data[0].split():
- typ, data = M.fetch(num, '(RFC822)')
- print 'Message %s\n%s\n' % (num, data[0][1])
- M.close()
- M.logout()
Add Comment
Please, Sign In to add comment