How to send WordPress emails through Microsoft 365 with FluentSMTP

Why

  • Your hosting provider permits a limited number of emails per day, or does not permit emails to be branded. As such, you need another solution for sending emails.

FluentSMTP

FluentSMTP is a free and open-source mail plugin for WordPress. It sends emails through a dedicated email service such as Microsoft 365 or Gmail. WordPress has the ability to send emails directly, but a dedicated service tends to have greater reliability and capacity.

These instructions are specific to the Microsoft 365 connector. FluentSMTP can connect to many different email services. One advantage of Microsoft 365 is that many businesses are already using the service. However, Microsoft 365 is not suitable for bulk emailing. If you are sending more than transactional emails, you may need to consider a dedicated bulk mail service. FluentSMTP supports a variety of bulk mailers that you can review. In the meantime, here is how to configure Microsoft 365.

There are three parts to installation:

  1. Install and activate the FluentSMTP WordPress plugin.
  2. Create an app registration in Azure so FluentSMTP can connect to your account.
  3. Configure FluentSMTP with your app registration.

Instructions

  1. Sign into your WordPress site with an admin account

    You need an account that can install and configure plugins.

  2. Install and activate the FluentSMTP plugin

    FluentSMTP is a free and open-source WordPress Plugin. It will connect to your Microsoft 365 / Office 365 account for sending emails from WordPress.

  3. Go to Settings > FluentSMTP from the side menu

  4. If you have never added a connection, click Microsoft in the list of available connections. Otherwise click + Add New Connection to add another connection.

  5. Specify the From Email address

    In a later step, you will authenticate into your Microsoft 365 environment with a user account. That user account must have access to the From Email inbox. You can specify a shared mailbox as long as the user account has permission to Send As or Send On Behalf the shared mailbox.

  6. Keep the page open, and open a new browser tab

    You need to complete some steps on Azure using some of the information from the FluentSMTP configuration screen. Keep WordPress open and start a new browser tab for connecting to Azure.

  7. Sign into the Azure portal with an admin account

    You will need an Azure account, but a paid Azure subscription is not required.

  8. Search for and go to App registrations from the top search bar

  9. Click + New registration

  10. Set the title, e.g., FluentSMTP Email Sender

    You can change the name later.

  11. Select multi-tenant

    You must select multi-tenant: FluentSMTP does not support single tenant (you will get error code AADSTS50194 when attempting to generate an access token later). Note that you cannot change your selection. If you want to change the supported account types, you must register a new application and reconfigure FluentSMTP.

  12. Set the platform to Web

  13. Set the redirect URL to the App Callback URL value shown on the FluentSMTP plugin settings page.

    Switch browser tabs and copy the App Callback URL shown on the settings page. Paste this into the Redirect URL setting on the app registration page.

  14. Click Register to create your app registration

    After a moment your app registration details will be shown.

  15. Copy Application (client) ID to the FluentSMTP setting

    Look for Application (client ID) and copy the value. Switch to the FluentSMTP settings page in WordPress and paste the value into the Application Client ID text box.

  16. Go back to your app registration tab on Azure

  17. On the left menu, expand Manage and select Certificates & Secrets.

  18. Click New client secret.

  19. Set a description, e.g., “FluentSMTP Secret”.

  20. Set an expiration date, e.g., 180 days

    For security purposes the secret must have an expiration date.

  21. Click Authenticate with Office365 & Get Access Token.

    A new page will open and you will see an authentication token. Copy it. If you see an error or an empty text box, you need to investigate the error. There should be an error code somewhere in the query string (address bar) in the format “AADSTxxxxx” where xxxxx is five digits. For example, “AADSTS50194”. Look up this error code with an AI or search engine and resolve the issue.

  22. Sign in and click Accept to approve the permissions request

    You will notice that FluentSMTP is connecting to the app you registered early in the steps. You will see unverified on the dialog box. Click it to view details, but this is expected because you did not verify your app registration.

  23. Copy all of the text in the Your Access Code text box.

    Once you close the tab, you will not be able to see it again.

  24. Go back to the FluentSMTP settings and paste into the Access Token text box.

  25. Click Save Connection Settings on the bottom of the FluentSMTP settings page.

Reference

Leave a Reply