The WordPress + Exchange Online Email plugin uses Microsoft Graph to send emails on your behalf and is therefore secured using Azure Active Directory. Hence, to get things working, you first will need to register your WordPress website with your Azure Active Directory (Azure AD) tenant. This will give you an Application ID and Application Secret for use with the WordPress + Exchange Online Email Plugin. Sounds complicated? Just stick to instructions below and you will find that it is not more difficult than configuring any other WordPress email plugin that uses SMTP.
If you have further questions after reading through this section or the plugin is not working according to your expectations, you can acquire additional support.
Don’t try and install the plugin if:
- You don’t have an Exchange Online account (e.g. as part of your Office 365 E1, E3 or E5 license).
- You do not have global administration priviliges for your Office 365 / Azure Active Directory. If you don’t, you cannot grant permissions for the plugin to send emails on behalf of an Exchange Online account.
- Your website is not secured with SSL.
- You would like to be able to send attachments (not supported yet).
- You would like to be able to configure a reply-to address that is different from the email-from address (not supported).
Installing the wpo365-mail plugin
- Open the plugin’s settings page by clicking “Settings”.
- Start by creating an app in Microsoft’s App Registration Portal (v2.0) and give it an easy-to-remember name e.g. “WordPress Mailer”.
- Whilst still in the Application Registration Portal, scroll down to “Application Secrets” and click “Generate New Password”. This password will be shown only once, so make sure you save it temporarily e.g in Notepad.
- Continue scrolling down to “Platforms” and click “Add Platform”. From the options available select “Web”. This will allow your WordPress website to access the Microsoft Graph on your behalf. Copy the “Admin consent URL” that is already filled out for you on the Plugin Settings page – the web address should start with https or else Microsoft will not allow you using the it.
- Finally scroll to “Microsoft Graph Permissions” and add an “Application Permission” by clicking “Add” and from the available options select “Mail.Send”.
- Make sure that you have copied the Application ID and the password you generated during step 2 before you save and close Microsoft’s Application Registration Portal.
- As a final preparation step, you will need to get your (Azure) Active Directory ID. You can find this ID if you open Azure Portal and click “Azure Active Directory” followed by “Properties”. The Tenant ID is visible on this page where it is called “Directory ID”.
- Now you can fill out the missing settings below. When finised, you must click “Save Changes”. The settings will be saved and the plugin will send a test email to the address you entered for “Email-from address”.
- If the email was sent successfully, you will see “Settings OK” at the top of the settings page. If an error occurred, however, you will see a message “Please check your settings”.
- Please note, that you when you save your settings for the first time, you have not granted permissions for the Application you just registered in the Application Registration Portal, yet. So, after you saved the settings on this page, you must – as an Azure Active Directory Administrator – grant permissions for the Application you just registered using the Application Registration Portal. To do so, click the “Admin Consent” button at the bottom of the page. Ps, You only need to grant permissions once.
- After succesfully granting permission, you can verify your configuration one more time by clicking “Save Changes” again. Now you should see “Settings OK”. Ps, It may take a few minutes before the Application you registered in Application Registration Portal is available.