For sending emails with Office 365 you need to configure the SMTP server and the email sender.
Configure SMTP Server
Set the following values in the settings of the SMTP-Server
|587 (25 works too)
|User credentials used for access to the Office 365
Are the user credentials wrong, the following error message will be shown, when sending the emails.
"The SMTP server required a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM ..."
Configure Email Sender
Office 365 validates email of the sender and does not allow sending emails from unknown addresses.
The email must match the registered one in Office 365. Please use the same email address for sender, you have used in the user credentials during configuration of the SMTP server.
Is there an unknown email detected, the following error message will be shown during sending emails.
"Transaction failed. The server response was: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message..."
For further details please refer to the following page
How to set up a multifunction device or application to send email using Office 365