Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. # Small script designed to print out the number of new emails at a University
  2. # of Kent email account. Intended to be run with Conky, but feel free to
  3. # modify for whatever.
  4. # by Michael "Squirrels" Garwood
  5.  
  6. import imaplib
  7.  
  8. username = “YOUR_EMAIL_HERE”
  9. password = “YOUR_PASSWORD_HERE”
  10. mailAgent = imaplib.IMAP4_SSL(“pod51000.outlook.com)
  11. mailAgent.login(username, password)
  12.  
  13. mailAgent.select(“Inbox”)
  14.  
  15. typ, newMsgs = mailAgent.search(None, ‘UNSEEN’)
  16.  
  17. print len(newMsgs[0].split())
  18.  
  19. mailAgent.close()
  20. mailAgent.logout()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement