Send email using Microsoft Graph
Use this guide if you want to configure the WordPress + Office 365 plugin to send emails from your WordPress website using Microsoft Graph.
Before you start
- You must already have configured the single sign-on capability of the WordPress + Azure AD / Microsoft Office 365 plugin.
- You must also already have configured the app-only integration capability of the plugin.
- You are a Global Administrator for your company’s Office 365 tenant / Azure AD directory (or have at least the ability to edit the app-only Azure Active Directory App registration that was created previously to add / ensure that the Mail.Send application permission has been added).
- You are an Administrator for your WordPress website.
- In Azure Portal click the 'hamburger' (icon with three horizontal lines in the upper corner) to open the menu.
- Navigate to Azure Active Directory > App registrations.
- Select the App registration that you created when you configured the app-only integration portion of the plugin.
- Click API permissions from your App registration's menu on the left
- Click + Add permission.
- Select Microsoft Graph > Application permissions.
- Scroll down to Mail and check
- Click Add permissions.
Wait until Grant admin consent for … has become available, then click to grant consent for all users in your tenant to use this ‘App registration’.
Delete all tokens
- Navigate to the plugin's wizard WP Admin > WPO365 and click Integration.
- Click Delete all tokens.
- Sign out of your WordPress website.
- Sign back in with Microsoft.
This step is needed to ensure that the plugin refreshes the access token previously retrieved so that the updated permissions are reflected in your personal access token that the plugin retrieves when you sign back into your website with Microsoft.
Configure the Graph Mailer
- Go to WP Admin > Plugins > All plugins and ensure that you have disabled all other email sending plugins.
- Navigate to the plugin's wizard WP Admin > WPO365 and click Mail.
- Check the option to Send WP emails using Microsoft Graph.
- Enter the user principal name (UPN, the user's Microsoft 365 / Azure AD login name e.g. email@example.com) of the user from which (Exchange Online) account the emails will be sent.
- To send a test email upon saving the current configuration, enter the one or more (comma or semi colon separated email addresses e.g. firstname.lastname@example.org, email@example.com.
- Select the MIME type (formatting) of the outgoing email (customers that purchased the WPO365 | SYNC or WPO365 | INTRANET extension can choose between Text and HTML).
- Optionally (customers that purchased the WPO365 | SYNC or WPO365 | INTRANET extension) can choose for outgoing emails to be saved in the user's Sent Items folder.
- Click Save configuration + Send test email and wait for the corresponding feedback.
Please note that the following features are currently not supported:
- Send an attachment
- Configure a different reply-to email address