from office365api import Mail
auth = ('YourAccount@office365.com', 'YourPassword')
mail = Mail(auth=auth)
messages = mail.inbox.get_messages()
from office365api import Message, Mail
from office365api.model import Recipient, EmailAddress
auth = ('YourAccount@office365.com', 'YourPassword')
message = Message(Subject='Heads up', Body='First automated alarm.',
From=Recipient(EmailAddress=EmailAddress(Name='Full Name', Address='you@gmail.com')),
ToRecipients= [Recipient.from_email(email='somebody@gmail.com')]
)
m = Mail(auth=auth)
m.send_message(message)