# How to configure Office 365 in mail server settings? This document explains the steps involved in configuring Office 365 in Mail Server Settings on Endpoint Central. ## Authentication methods ### OAuth Authentication #### Prerequisites - TLS 1.2 must be enabled on the server machine running Endpoint Central. - SMTP Client Authentication must be enabled in Microsoft 365. [Refer this for more info](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission) In order to achieve the OAuth authentication for configuring the mail server, follow the steps given below: - Login to Endpoint central and click **Admin -> Server Settings -> Mail Server.** - Specify the information given below: - Server Name : **smtp.office365.com** - Port : **587** - Sender Email Address: **Any email address with an independent mailbox (not a shared one)** - Test Email Address: **Any Email Address** - Email Type: **SMTP** - Enable TLS: **Yes** - Username: Any Email address with an **Exchange Online License** and Application Administrator role. #### Note - To add Application Administrator role in Azure (admin.cloud.microsoft→ Users → search for the authenticating user → Roles → Application Administrator). - The email ID provided in the Username field will be used for authentication. - If Username and Sender Email Address differ, Send on Behalf permission is required. Follow the instructions given below to verify Exchange Online License: ### Exchange Online License Login to Microsoft admin center and navigate to **Users -> Active Users -> Properties -> Licenses and apps.** Enable Authenticated SMTP via **Mail -> Email apps.** ![Oauth1](https://www.manageengine.com/products/desktop-central/images/Oauth1.png) #### If Username and Sender Email Address are the same ![Oauth2](https://www.manageengine.com/products/desktop-central/images/Oauth2.png) Verify criteria before saving. #### If Username and Sender Email Address are different ![Oauth3](https://www.manageengine.com/products/desktop-central/images/Oauth3.png) Ensure Send on Behalf permission is configured. ![Oauth4](https://www.manageengine.com/products/desktop-central/images/Oauth4.png) ![Oauth5](https://www.manageengine.com/products/desktop-central/images/Oauth5.png) **To add Send on Behalf permission:** - Go to **Microsoft admin center -> Users -> Active Users** - Select user → Mail tab → Send on behalf ### App Registrations ![Oauth6](https://www.manageengine.com/products/desktop-central/images/Oauth6.png) - Navigate to **App Registrations -> New registration** - Enter name and account type ![Oauth7](https://www.manageengine.com/products/desktop-central/images/Oauth7.png) - Copy Redirect URL from Endpoint Central ![Oauth8](https://www.manageengine.com/products/desktop-central/images/Oauth8.png) - Paste Redirect URL and register ![Oauth9](https://www.manageengine.com/products/desktop-central/images/Oauth9.png) ![Oauth10](https://www.manageengine.com/products/desktop-central/images/Oauth10.png) ### Client Secret ![Oauth11](https://www.manageengine.com/products/desktop-central/images/Oauth11.png) - Create new client secret ![Oauth12](https://www.manageengine.com/products/desktop-central/images/Oauth12.png) #### Recommendation Choose the longest expiry period available. Enter Client ID and Client Secret in Endpoint Central. ### API Permissions - **SMTP.Send** — Send emails - **offline_access** — Token refresh - **User.Read** — Read profile **Steps:** - Go to App → API Permissions - Add Microsoft Graph → Delegated - Grant admin consent #### Important Ensure Username matches Azure authentication account. Now, you have successfully configured OAuth Authentication. ### Basic Authentication #### Note OAuth is recommended. - Click **Admin -> Server Settings -> Mail Server Settings** - Server Name : **smtp.office365.com** - Port : **587** - Sender Email Address: **Any email address with mailbox** - Test Email Address: **Any Email Address** - Email Type: **SMTP** - Enable TLS: **Yes** - Username: **Send on Behalf enabled user** - Password: **Specify password** You have successfully configured Office 365.