Send Emails Using Secure Microsoft Graph API from Website
Need IT Support? Visit support.itofus.com and Open a Ticket.
Register New App on Azure Active Directory
https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps
Register New Application
Enter Name
Select Accounts in this organizational directory only
Select Redirect URI as Web
Enter your website URL https://www.yourdomain.com
Authentication
Change Allow public client flows to Yes
Cretificates and Secrets
Create Secret
Copy and Save Secret Value
Token
Create Token ID UPN
Create Token ID Email
Save
Select Turn on the Microsoft Graph email, profile permission (required for claims to appear in token).
API Permissions
Add Permission - Microsoft Graph - Delegated
- Mail.Send
- Mail.Send.Shared
- Mail.Read
- Mail.Read.Shared
- Mail.ReadWrite
- Mail.ReadWrite.Shared
Grant Admin Consent
Overview
Copy and Save Application (Client) ID
Copy and Save Directory (Tenant) ID
WordPress
Install Plugin https://wordpress.org/plugins/wpo365-login/
Configure Email
- Enter Tenant ID
- Enter Application ID
- Enter Secret Value (NOT ID)
- Enter Redirect URI (Same as Create on the App Registration)
- Enter From Email (Valid Office 365 Mailbox)
- Click Authorize and Follow the Office 365 Login Process
- Save Configuration and Send Test Email