daily pastebin goal

Fetching the Email on Top from your Gmail account

kanchanrocker Aug 17th, 2014 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import imaplib
  2. mailserver=imaplib.IMAP4_SSL("imap.gmail.com",993)
  3. uemail=raw_input("Enter your Email::")
  4. password=raw_input("Enter your Password::")
  5. mailserver.login(str(uemail),str(password))
  6. status,count=mailserver.select("Inbox")
  7. status,data=mailserver.fetch(count[0],"UID BODY [TEXT]")
  8. print data[0],[1]
  9. mailserver.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand