Guest User

Untitled

a guest
Jul 27th, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ## yamail.py [python]
  2.  
  3. #!/usr/bin/python
  4. # -*- coding: utf-8 -*-
  5.  
  6. import imaplib
  7.  
  8. username = "***"
  9. password = "***"
  10. host = "imap.yandex.ru"
  11. port = 993
  12.  
  13. m = imaplib.IMAP4(host,port)
  14. m.login = (username, password)
  15. n = m.recent()
  16.  
  17. if n == 0:
  18. print "0 new"
  19. else:
  20. print str(n)+" new"
Add Comment
Please, Sign In to add comment