Advertisement
Guest User

Untitled

a guest
Nov 11th, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import email
  2. import imaplib
  3.  
  4.  
  5. server = "imap.mail.ru"
  6. port = "993"
  7. password = "moms_lover"
  8. imaplib.Debug = 4
  9. get_mail = imaplib.IMAP4_SSL(server, port)
  10. get_mail.login(login, password)
  11. get_mail.select('INBOX', readonly=True)
  12. typ, data = get_mail.search(None, 'UNSEEN')
  13. for i in data[0].split():
  14. typ, data = get_mail.fetch(i, '(RFC822)')
  15. print(data[0][1])
  16. msg = email.message_from_bytes(data[0][1])
  17. print(msg.get_payload(0))
  18. get_mail.close()
  19. get_mail.logout()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement