Skip to content

Commit

Permalink
add oauth2 example
Browse files Browse the repository at this point in the history
  • Loading branch information
ikvk committed May 12, 2021
1 parent 3e1719d commit 04876b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/oauth2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from imap_tools import MailBox

# Authenticate to account using OAuth 2.0 mechanism
with MailBox('imap.my.ru').xoauth2('user', 'token123', 'INBOX') as mailbox:
for msg in mailbox.fetch():
print(msg.date_str, msg.subject)

0 comments on commit 04876b4

Please sign in to comment.