from office365api import Mail auth = ('YourAccount@office365.com', 'YourPassword') mail = Mail(auth=auth) messages = mail.inbox.get_messages()