Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- result, data = mail.uid('search', None, "UNSEEN")
- if result == 'OK':
- print (data[0].split())
- for num in data[0].split():
- try:
- result, data = mail.uid('fetch', num, '(RFC822)')
- if result == 'OK':
- msg = email.message_from_bytes(data[0][1])
Add Comment
Please, Sign In to add comment