Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import email
- import imaplib
- server = "imap.mail.ru"
- port = "993"
- login = "[email protected]"
- password = "moms_lover"
- imaplib.Debug = 4
- get_mail = imaplib.IMAP4_SSL(server, port)
- get_mail.login(login, password)
- get_mail.select('INBOX', readonly=True)
- typ, data = get_mail.search(None, 'UNSEEN')
- for i in data[0].split():
- typ, data = get_mail.fetch(i, '(RFC822)')
- print(data[0][1])
- msg = email.message_from_bytes(data[0][1])
- print(msg.get_payload(0))
- get_mail.close()
- get_mail.logout()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement