In SMTPPai this provider is labeled Microsoft 365/Outlook. You register a Web app in Microsoft Entra, add the redirect URI https://auth.mailpai.com/microsoft, grant SMTP.Send, then click Connect to Microsoft. Personal Hotmail/Outlook.com accounts are supported; SMTPPai selects the correct SMTP host after sign-in.
When to choose Microsoft 365/Outlook
- Mail should send from a Microsoft 365 mailbox or a personal Outlook/Hotmail/Live address.
- You can register apps in Microsoft Entra → App registrations.
- You are fine authorizing through the MailPai relay at
https://auth.mailpai.com/microsoft.
Prerequisites
- Access to create an Entra app registration
- Ability to create a client secret
- Permission to add delegated Office 365 Exchange Online → SMTP.Send (admin consent if your tenant requires it)
- For personal accounts: choose account types that include personal Microsoft accounts
Open SMTPPai
- SMTPPai → Dashboard → Add connection
- Click Microsoft 365/Outlook
Field-by-field setup
Connection name
Example: “Microsoft 365 mail”.
From name / From email
Usually filled automatically after authorization. Hotmail and Outlook.com personal accounts are supported.
Application Client ID and Client Secret
- Open Microsoft Entra → App registrations → New registration.
- Choose platform type Web.
- Under Supported account types, pick personal Microsoft accounts and work/school accounts if you use Hotmail or Outlook.com.
- Create a client secret and copy its value immediately.
- Paste Application (client) ID and secret into SMTPPai.
Authorized Redirect URI
- Copy the redirect URI from the SMTPPai form.
- It must be exactly:
https://auth.mailpai.com/microsoft - In Entra: your app → Authentication → Web redirect URIs → add that URI → Save.
Do not use your WordPress site URL as the redirect URI for this flow.
API permissions
- In the Entra app, open API permissions.
- Add delegated permission Office 365 Exchange Online → SMTP.Send.
- Grant admin consent if your organization requires it.
SMTPPai reads the mailbox address from the OpenID sign-in response — you do not need Microsoft Graph User.Read for this. Microsoft guide: Authenticate an IMAP, POP or SMTP application using OAuth.
Credential storage
define( 'MAILPAI_SMTP_OAUTH_MICROSOFT_CLIENT_ID', 'your-client-id' );
define( 'MAILPAI_SMTP_OAUTH_MICROSOFT_CLIENT_SECRET', 'your-client-secret' );
Or store in the database (encrypted when possible).
Connect to Microsoft (required)
- Save the connection.
- Click Connect to Microsoft on the Dashboard card.
- Sign in and approve SMTP send permission.
- You should return to WordPress automatically.
Authorization code (if redirect fails)
If the relay shows a token page with an authorization code but WordPress does not update, copy that code, paste it into the Authorization code field in SMTPPai, and click Complete authorization.
Hotmail / Outlook.com SMTP host
Personal accounts (@hotmail.com, @outlook.com, @live.com) send through smtp-mail.outlook.com. Work Microsoft 365 mailboxes typically use smtp.office365.com. SMTPPai selects the host after sign-in — you do not type the host manually for this provider.
Save and test
After Connect succeeds: Test → check inbox → confirm Email Log.
Common failures
- Redirect URI not exact
- Missing SMTP.Send permission or missing admin consent
- Account type setting that excludes personal accounts when you sign in with Hotmail
- Skipped Connect / incomplete authorization
Related: Google Workplace/Gmail · Send a test email
