Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from exchangelib import DELEGATE, Account, Credentials
  2. from creds import PASSWORD, USERNAME, EMAIL
  3.  
  4. creds = Credentials(
  5. username=USERNAME,
  6. password=PASSWORD)
  7. account = Account(
  8. primary_smtp_address=EMAIL,
  9. credentials=creds,
  10. autodiscover=True,
  11. access_type=DELEGATE)
  12.  
  13. # Print first 100 inbox messages in reverse order
  14. for item in account.inbox.all().order_by('-datetime_received')[:1]:
  15. print(item.subject, item.body, item.attachments)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement