How to Configure Microsoft 365/Outlook

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

  1. Access to create an Entra app registration
  2. Ability to create a client secret
  3. Permission to add delegated Office 365 Exchange Online → SMTP.Send (admin consent if your tenant requires it)
  4. For personal accounts: choose account types that include personal Microsoft accounts

Open SMTPPai

  1. SMTPPai → Dashboard → Add connection
  2. 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

  1. Open Microsoft Entra → App registrationsNew registration.
  2. Choose platform type Web.
  3. Under Supported account types, pick personal Microsoft accounts and work/school accounts if you use Hotmail or Outlook.com.
  4. Create a client secret and copy its value immediately.
  5. Paste Application (client) ID and secret into SMTPPai.

Authorized Redirect URI

  1. Copy the redirect URI from the SMTPPai form.
  2. It must be exactly: https://auth.mailpai.com/microsoft
  3. 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

  1. In the Entra app, open API permissions.
  2. Add delegated permission Office 365 Exchange Online → SMTP.Send.
  3. 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)

  1. Save the connection.
  2. Click Connect to Microsoft on the Dashboard card.
  3. Sign in and approve SMTP send permission.
  4. 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

Did this article help you?

Your vote shapes what we improve next.

Leave a comment