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. Also see the following video

Please Note

It is possible to use the Graph Mailer without configuring other capabilities such as single sign-on. In that case please note that you still must enter the Tenant ID on the Single sign-on tab.

Check out the WPO365 | MAIL extension to send HTML formatted emails and save sent items to the corresponding Sent Items folder of the account used. This extension is also included in the any of the bundles.

Before you start

  • 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.

App registration

  • 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.

API Permissions

  • 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
    • Mail.Send
  • 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’.
At this point you must be aware of the fact that you have now granted an application identity the unlimited permission to send emails as any user in your organization and ensure that you have taken sufficient precautions to protect your website against attacks.

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. of the user from which (Exchange Online) account the emails will be sent.
  • Optionally (starting with v15.1) you can configure a reply-to address. If configured, the recipient's reply will be sent to this email address (instead of to the email address where the email originally was sent from).
  • To send a test email upon saving the current configuration, enter the one email address e.g. or multiple email addresses separated by a "|" e.g.|
  • Developers who have installed WordPress on their localhost, may check Fix WordPress@localhost issue to prevent WordPress from trying to send emails from WordPress@localhost which eventually will result in an error.
  • Select the MIME type (formatting) of the outgoing email (customers that purchased the WPO365 | MAIL extension that is also included in the WPO365 | SYNC or WPO365 | INTRANET bundles 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
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us