Guest User

Untitled

a guest
Sep 24th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. result, data = mail.uid('search', None, "UNSEEN")
  2. if result == 'OK':
  3. print (data[0].split())
  4. for num in data[0].split():
  5. try:
  6. result, data = mail.uid('fetch', num, '(RFC822)')
  7. if result == 'OK':
  8. msg = email.message_from_bytes(data[0][1])
Add Comment
Please, Sign In to add comment