Go to System Administration => Setup => Email => Email parameters.
Verify that SMTP is enabled.
Set the SMTP mail server settings.
outgoing mail server = smtp.office365.com
SMTP port number = 587
Fill the username and password accordingly