# Set Up Outlook as an Email Server

Cloud Voice can route its email through your organization's Microsoft 365 account instead of a generic mail relay. Rather than storing a mailbox password, the connection relies on modern (OAuth) authentication: you register an application in Microsoft Entra ID, hand its credentials to Cloud Voice, and grant consent once. After that, Cloud Voice sends notifications, voicemail-to-email, faxes, and other messages as your Microsoft account.

The setup has three parts: copy a redirect URI (the web address Microsoft returns to after sign-in) out of Cloud Voice, register an Entra ID application that trusts it, then paste the application's credentials back into Cloud Voice and authorize the connection.

## Requirements

| Platform | Requirement |
| --- | --- |
| Cloud Voice | Firmware **84.14.0.24** or later; **Enterprise (EP)** or **Ultimate (UP)** plan. |
| Microsoft 365 | A Microsoft account with the **Global Administrator** role and a **Microsoft 365 Business Standard** license, plus [modern authentication enabled](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/enable-or-disable-modern-authentication-in-exchange-online#using-the-microsoft-365-admin-center) in the Microsoft 365 admin center. |

:::note
The Microsoft account you use becomes the designated sender for the SMTP (Simple Mail Transfer Protocol, the standard for sending email) server, so every message Cloud Voice sends appears to come from it.
:::

## Step 1. Copy the redirect URI from Cloud Voice

Cloud Voice generates a redirect URI that Microsoft Entra ID needs to trust. Grab it first so you can paste it during registration.

1. Sign in to the Cloud Voice admin portal and go to **System > Email > Email Server**.
2. Set **Type of Email Server** to **Custom Email Server**.
3. Set **Select Email Server Provider** to **Microsoft**.
4. In the **Redirect URI** field, select and copy the URI you want to use.

![Cloud Voice, the Email Server page with the Microsoft provider selected and the Redirect URI field highlighted](/images/pbx/pbx-redirect-uri-cloud.png)

## Step 2. Register an application in Microsoft Entra ID

Create an Entra ID application that trusts the redirect URI from Step 1, then collect the three credentials Cloud Voice will need: the tenant ID, the client ID, and a client secret.

1. Sign in to the [Microsoft Azure portal](https://portal.azure.com/) with your Global Administrator account.
2. Search for and open the **Microsoft Entra ID** service to reach your organization's directory.

   ![The Azure portal search bar with the Microsoft Entra ID service selected](/images/pbx/search-aad.png)

3. In the directory's left navigation, open **App registrations** and click **New registration**.

   ![The App registrations page with New registration selected](/images/pbx/create-an-application.png)

4. On the **Register an application** page, fill in the registration details and click **Register**:

   - **Name**: a label that helps you recognize the application later.
   - **Supported account types**: choose **Accounts in this organizational directory only**.
   - **Redirect URI**: set the platform to **Web**, then paste the redirect URI you copied in Step 1.

   ![The Register an application page with the name, single-tenant account type, and Web redirect URI filled in](/images/pbx/register-an-application-cloud.png)

   When registration succeeds, you land on the application's **Overview** page.

5. On the **Overview** page, note the **Application (client) ID** and **Directory (tenant) ID**: you'll enter both into Cloud Voice.

   ![The application Overview page showing the client ID and tenant ID values](/images/pbx/copy-app-id-and-tenant-id.png)

6. Create a client secret for the application:

   a. In the application's left navigation, go to **Certificates & secrets > Client secrets** and click **New client secret**.

      ![The Certificates & secrets page with New client secret selected](/images/pbx/go-to-create-new-secret.png)

   b. Add a description, set an expiration date, and click **Add**. The new secret appears in the **Client secrets** list.

      ![The Add a client secret dialog with a description and expiration date](/images/pbx/add-a-new-secret.png)

      :::tip
      The secret stops working on the expiration date you choose. When it expires, Cloud Voice can no longer authenticate and email stops sending until you create a new secret and re-enter it. Pick a longer expiration to cut down on rotations, and set a calendar reminder ahead of the expiry date.
      :::

   c. Copy the secret's **Value** and store it somewhere safe.

      :::caution
      Copy the secret's value before you leave this page, Microsoft displays it only once. If you lose it, you'll have to generate a new secret.
      :::

      ![The Client secrets list with the secret Value ready to copy](/images/pbx/copy-secret-value.png)

## Step 3. Configure SMTP on Cloud Voice

Enter the Entra ID credentials in Cloud Voice, then complete a one-time Microsoft sign-in to authorize the connection.

1. In the Cloud Voice admin portal, go to **System > Email > Email Server**.
2. Set **Type of Email Server** to **Custom Email Server**.
3. Set **Select Email Server Provider** to **Microsoft**.
4. Enter the credentials you collected from the Entra ID application:

   - **Tenant ID**: the application's Directory (tenant) ID.
   - **Application (Client) ID**: the application's client ID.
   - **Client Secret**: the secret value you copied.

   ![Cloud Voice, the Microsoft email server form with the tenant ID, client ID, and client secret fields](/images/pbx/enter-ms-auth-info-pce.png)

5. Click **Save**. Cloud Voice redirects you to the Microsoft sign-in page.
6. Sign in with the Microsoft account that holds the **Global Administrator** role.

   ![The Microsoft account picker on the sign-in page](/images/pbx/pick-an-account.png)

7. In the consent window, select **Consent on behalf of your organization**, then click **Accept**.

   ![The Microsoft permissions consent dialog with the organization-wide consent option](/images/pbx/aad-permission-granting.png)

   Back on the Cloud Voice page, the **Status** field changes to **Connected**, confirming that authentication succeeded and Outlook is now the email server.

   ![Cloud Voice, the Email Server page showing a Connected status](/images/pbx/aad-auth-success.png)

8. Send a test message to confirm the server works:

   a. Click **Test**.

   b. In the pop-up, enter a recipient's address in the **Email Address** field and click **Test**.

## Result

When the test succeeds, the page shows **Success** and the recipient receives the message. The sender name and address match the Microsoft account's display name and user principal name, for example, `admin <admin@yourcompany.onmicrosoft.com>`.

To change the sender name on outgoing mail, update the display name on the Microsoft account.

![The Microsoft account profile page with the display name field highlighted](/images/pbx/outlook-change-display-name.png)

:::note
If the test fails, the page shows **Failed to send** along with an error message that describes the problem.
:::
