Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Small script designed to print out the number of new emails at a University
- # of Kent email account. Intended to be run with Conky, but feel free to
- # modify for whatever.
- # by Michael "Squirrels" Garwood
- import imaplib
- username = “YOUR_EMAIL_HERE”
- password = “YOUR_PASSWORD_HERE”
- mailAgent = imaplib.IMAP4_SSL(“pod51000.outlook.com”)
- mailAgent.login(username, password)
- mailAgent.select(“Inbox”)
- typ, newMsgs = mailAgent.search(None, ‘UNSEEN’)
- print len(newMsgs[0].split())
- mailAgent.close()
- mailAgent.logout()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement