# How to Setup Outlook Email

We currently provide integration between 3Dolphins and Outlook email. The following are prerequisites that you must meet before continuing with the integration:

* You must already have a business email.&#x20;
* The email must have an Office 365 subscription.

### Create App Registration on Microsoft Azure

After ensuring that you meet the minimum requirements listed above, please create a registration app on Microsoft Azure. First, sign in to the[ https://portal.azure.com/#home](https://portal.azure.com/#home) page using your business email account.

<figure><img src="/files/cieZkF4VztvBMLEvflfz" alt=""><figcaption><p>Dashboard Portal Azure</p></figcaption></figure>

Then, open the App Registrations menu. On the app registrations page, click the **'+ New Registrations'** button.

<figure><img src="/files/mQXLHlvTX1LRbPSbFSpe" alt=""><figcaption><p>New Registration</p></figcaption></figure>

Enter your application’s registration information:

1. **Name**: Enter the application name that will be displayed to the users.
2. Select **Accounts in any organizational directory and personal Microsoft accounts** option from the **Supported account types** section.
3. Select platform **'Web'** and filled URL with https\://\[url]/dolphin/channel/authorization/channel-email-outlook.xhtml

Then, click the **'Register'** button to create the application.

<figure><img src="/files/u9Wq55TFdlPV76uKbmIU" alt=""><figcaption><p>Register Application</p></figcaption></figure>

After a few moments, the newly created application registration will open.

<figure><img src="/files/eSfnghhBl5oUps403znD" alt=""><figcaption><p>Created App Registration</p></figcaption></figure>

{% hint style="info" %}
Save the Client ID and Tenant ID information from your app.
{% endhint %}

Create your client credentials by clicking the **'Add a certificate or secret'** button. Then, click the **'New client secret'** button.

<figure><img src="/files/QbwBHn8knwaE2RoAs40u" alt=""><figcaption></figcaption></figure>

In the dialog that pop-up, enter an optional description for the client secret and select periode expired from the Expires drop-down list button, and then Click the **'Add'** button.

<figure><img src="/files/VgYiBoNBBlLkZkehzoVB" alt=""><figcaption><p>Add Client Secret</p></figcaption></figure>

Your client secret was successfully created. Remember to save the client secret's value and expiration date.

<figure><img src="/files/fV1l2CXTO6bU3iMxJhJj" alt=""><figcaption><p>Client Secret Added</p></figcaption></figure>

{% hint style="warning" %}
Save **"value"** because it only appears once. If you forget to copy it, you must recreate the client secret again.
{% endhint %}

### Modify IMAP & SMTP Via Windows Powershell

After successfully creating the Azure application, you must use Windows PowerShell to modify IMAP & SMTP email, so it has full access. Here are the command modify for each operating system.

#### Windows OS

First, open windows powershell as Administrator. Then, enter the following command.

<pre class="language-powershell"><code class="lang-powershell">Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
<strong>Install-Module -Name ExchangeOnlineManagement
</strong>Install-Module Microsoft.Graph 
Import-module ExchangeOnlineManagement
Install-Module -Name AzureADPreview
</code></pre>

Then, click Enter and enter Y. Wait until the installation package is complete then enter the next command.

```powershell
Connect-AzureAD -TenantId <tenant id>
```

Log in using your business email address and password. Wait until the process is complete. Then, enter the following command.&#x20;

```powershell
Connect-ExchangeOnline -Organization <tenant id>
```

Then, log in again with your business email. After connecting successfully, enter the application data into the variable by:

{% code overflow="wrap" %}

```powershell
$MyApp = Get-AzureADServicePrincipal -SearchString "your app name"
```

{% endcode %}

{% code overflow="wrap" %}

```powershell
New-ServicePrincipal -AppId $MyApp.AppId -ServiceId $MyApp.ObjectId -DisplayName "Service Principal for IMAP"
```

{% endcode %}

{% code overflow="wrap" %}

```powershell
Add-MailboxPermission -Identity youraddressmail@microsoft.com -User $MyApp.ObjectId -AccessRights FullAccess
```

{% endcode %}

Your email channel can receive inbound emails if you are already on this step. The following is the command to get full access to outbound email.

{% code overflow="wrap" %}

```powershell
Set-CASMailbox -Identity youraddressmail@microsoft.com -SmtpClientAuthenticationDisabled $false
Set-CASMailbox -Identity yourbusinessemail@mailmicrosoft.com -IMAPEnabled $true
```

{% endcode %}

#### Mac OS

If your operating system is Mac, you must first install Powershell using the terminal command below.

```shell
brew install --cask powershell
```

Then, open windows powershell as Administrator and enter the following command.

```powershell
Register-PSRepository -Default
Install-Module -Name ExchangeOnlineManagement -allowprerelease
Install-Module Microsoft.Graph -allowprerelease
Install-Module -Name Az
Import-module ExchangeOnlineManagement
```

Then, click Enter and enter Y. Wait until the installation package is complete then enter the next command.

```powershell
Connect-AzAccount -Tenant <your tenant id>
```

Log in using your business email address and password. Wait until the process is complete. Then, enter the following command.&#x20;

```powershell
Connect-ExchangeOnline -Organization <your tenant id> 
```

Then, log in again with your business email. After connecting successfully, enter the application data into the variable by:

```powershell
$MyApp = Get-AzADServicePrincipal -SearchString "your app name"
```

{% code overflow="wrap" %}

```powershell
New-ServicePrincipal -AppId $MyApp.AppId -ServiceId $MyApp.Id -DisplayName "Service Principal for IMAP"
```

{% endcode %}

{% code overflow="wrap" %}

```powershell
Add-MailboxPermission -Identity yourbusinessemail@microsoft.com -User $MyApp.Id -AccessRights FullAccess
```

{% endcode %}

Your email channel can receive inbound emails if you are already on this step. The following is the command to get full access to outbound emails.

{% code overflow="wrap" %}

```powershell
Set-CASMailbox -Identity yourbusinessemail@mailmicrosoft.com -SmtpClientAuthenticationDisabled $false
Set-CASMailbox -Identity yourbusinessemail@mailmicrosoft.com -IMAPEnabled $true
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.3dolphins.ai/integration/channel-connector/email-inbox/how-to-setup-outlook-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
