# 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2FpY8oiVi3wvkO1KMpWAol%2FWelcome%20To%20Azure.png?alt=media&#x26;token=a306b96b-d994-4e7a-a4df-1a044c4572cc" 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2F0Ma8Dek6An9RVcpyZmeM%2Fnew%20registration%20new%20edit.png?alt=media&#x26;token=afd0f8ff-01e8-4f0a-a8c0-043ca3687b42" 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2FNGrA4W4irocT2DLnPIW0%2FRegister%20application%20edit.png?alt=media&#x26;token=d3daf918-f436-4e84-8c9b-2900dc024eed" alt=""><figcaption><p>Register Application</p></figcaption></figure>

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

<figure><img src="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2F2W8PrRXbq9r2kVJm7juD%2Fsuccess%20register%20application%20edit.png?alt=media&#x26;token=f2a10820-d0d0-44c4-9374-e417d94cad9d" 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2F43sfVTPLjhaYLsVYAuNG%2FNew%20client%20secret.png?alt=media&#x26;token=1eadd6f8-f73b-462b-a4f8-dca44c84e644" 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2Fbp0AOdruN78cJwcdfesP%2Fadd%20client%20secret.png?alt=media&#x26;token=b4d57d13-dce8-4d1f-9748-4fb89e23e01b" 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="https://765826444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYDAnLjpg2T8z2BplJOS%2Fuploads%2FN4GyIQuIKqR2wXL66yMw%2Fsuccess%20add%20client%20secret%20edit.png?alt=media&#x26;token=718fea56-e244-4d11-8e4b-de1ee4069056" 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 %}
