Microsoft 365 mail sender

Overview

IMPORTANT: This service is available as of Sitefinity CMS patch version 14.4.8123. Dependency mismatch is possible if the order of the steps in this article is not followed. 

You can configure your notification profile to use Microsoft 365 and their SMTP servers. First, you must register your application in Microsoft Entra ID and ensure it has the proper permissions.

  1. Create or use your Microsoft Exchange registration to access the Azure portal. For more information, see Microsoft’s page Exchange Online
  2. Log in to the Azure Portal at https://portal.azure.com/ with your registration where you Microsoft Entra ID resides in. 
  3. Go toMicrosoft Entra ID and add a new app registration. For more information, see Microsoft’s documentation Register an app with Microsoft Entra ID
  4. For RedirectURI add https://www.microsoft.com/en-us/microsoft-365/exchange/exchange-online and choose Web from the dropdown. 
  5. Once the app is registered, open it to add API permissions.   
  6. Add the following Microsoft Graph permissions as application permission type:
  7. From the APIs your organization use, add the following Office 365 Exchange Online permission as application permission type: 
    • SMTP.SendAsApp 
  8. Create a new secret. For more information, see Microsoft’s documentation Add a client secret
    Make sure to save the secret value for later as you need it to complete the setup. 
  9. Get your Application (client) ID and Directory (tenant) ID from your newly registered app overview page in Microsoft Entra ID. 

Installation

You must install a custom notification sender project to be able to use your  Microsoft 365 app with Sitefinity CMS.

  1. Download the mail sender solution from this GitHub repository
  2. Copy the Progress.Sitefinity.Office365.Mail.Sender folder and paste it in the same directory as your Sitefinity CMS solution. 
  3. Open your Sitefinity CMS solution with Visual Studio.
  4. In case the mail sender project isn’t visible under your Sitefinity CMS solution, import it manually by right clicking on the solution » Add » Existing project. 
  5. Add a reference to the mail sender project from your SitefinityWebApp. 
  6. Build the entire solution.

To use the Microsoft 365 mail sender, you must update the following libraries in your SitefinityWebApp project to the indicated versions: 

  • Azure.Identity to Version=1.10.3 
  • Azure.Core to Version=1.35.0
  • System.Diagnostics.DiagnosticSource to Version=6.0.1 
  • System.Text.Json to Version=6.0.0.0 

This is done to ensure there are no dependency conflicts between the mail sender and your Sitefinity CMS project. 

Set up the Mail Sender in the Sitefinity CMS backend

Finally, you need to configure the new profile in Sitefinity CMS backend.

  1. Go to Administration » Settings » Advanced » Notifications » Profiles
    A new profile, called Office365, is now available. 
  2. Add the respective values to the fields TenantId, ClientId, and ClientSecret in this profile.
  3. Fill out the DefaultSenderEmail and the Host fields as they are required for the service.
    For the Host field you can fill out Office365 for example.
  4. Save your changes.
  5. Go to Notifications » DefaultProfiles » smtp.
  6. Set the new ProfileName to be Office365.
  7. Save your changes.

To use email campaigns, you also need to configure the Office365 profile as the Newsletters SMTP profile. 

  1. Navigate to Administration » Settings » Advanced » Newsletters.
  2. Type Office365 in the Notifications SMTP Profile field.
  3. Click Save Changes

Test the mail sender

To test the mail sender:

  1. Navigate to Administration » Settings » Email settings.
  2. Click Send Test Email.
  3. Fill out the email that would receive the test message.
  4. Click Send test.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?