keepcalculator

06 Numbers and Powers

Office 365 SMTP Setup for WordPress Email

Card No. 06·70497 · Updated · Standard formula, shown below

This guide walks you through configuring WordPress to send emails through Office 365 (Microsoft 365) SMTP, which ensures your site’s messages (password resets, notifications, contact forms) are delivered reliably and don’t land in spam. You’ll need an Office 365 mailbox, an SMTP plugin, and a few minutes to enter the correct server settings.

What You’ll Need

  • A WordPress admin account (to install plugins and edit settings)
  • An Office 365 / Microsoft 365 email account (e.g., you@yourdomain.com) with its password
  • Access to your domain’s DNS settings if you plan to use a custom domain (recommended for deliverability)
  • An SMTP plugin – the steps below use WP Mail SMTP, but the settings apply to most similar plugins

Step-by-Step

  1. Install and activate an SMTP plugin. In your WordPress dashboard, go to Plugins → Add New, search for “WP Mail SMTP,” install and activate it. Other popular options include Easy WP SMTP and FluentSMTP – the interface will differ slightly but the server values are the same.
  2. Open the plugin’s settings. Go to Settings → WP Mail SMTP (or the plugin’s own menu item). You’ll see a “Mailer” section – choose Other SMTP.
  3. Enter the SMTP host and port. Set the SMTP Host to smtp.office365.com and the port to 587. (Port 587 with STARTTLS is the standard for Office 365; port 25 is often blocked, and 465 is not officially supported).
  4. Enable encryption. Set the Encryption dropdown to TLS (this is STARTTLS). Do not choose SSL unless your plugin explicitly says “STARTTLS” – using the wrong encryption is the most common cause of failure.
  5. Turn on authentication. Check the box for “Use SMTP Authentication.” Enter the full email address of your Office 365 mailbox as the username (e.g., you@yourdomain.com) and the corresponding password as the SMTP password. If you have Multi-Factor Authentication (MFA) enabled, you’ll need an app password – see the Troubleshooting section.
  6. Set the “From” details. In the “From Email” field, enter the same address you used as the username. The “From Name” can be your site name. Many servers reject emails where the From address doesn’t match the authenticated mailbox, so keep them identical.
  7. Save the settings. Click “Save Settings.” The plugin will usually show a green success notice if the connection works.
  8. Send a test email. Use the plugin’s built-in “Send Email Test” feature (usually in the plugin’s settings page). Enter your own email address and click “Send.” Check your inbox and spam folder for the test message.
  9. Configure DNS (recommended for deliverability). If your domain isn’t already using Office 365, add the required SPF, DKIM, and DMARC records. In your domain registrar’s DNS, add an SPF record that includes include:spf.protection.outlook.com. For DKIM, enable it in the Microsoft 365 admin center and publish the provided CNAME records. DMARC is optional but helps protect your domain.
  10. Replace the default WordPress mail function. WP Mail SMTP automatically overrides the default wp_mail() function, so no code changes are needed. If you’re using a different plugin, confirm it has this feature.

Common Mistakes

  • Wrong port or encryption. Using port 465 or SSL will fail. Stick to 587 + TLS.
  • Using a password that’s not correct. If you have MFA enabled, your normal password won’t work – you must create an app password.
  • From address mismatch. If the From email is different from the authenticated mailbox, Office 365 will reject the message.
  • Forgetting to update DNS. Without SPF/DKIM, your emails may be marked as spam or rejected.
  • Using a free Outlook.com address instead of an Office 365 mailbox. Free accounts often have restrictions; this guide assumes a paid Microsoft 365 subscription.

Tips

  • Test with a real email address you control, and check the spam folder if it doesn’t arrive.
  • Keep your SMTP password secure – it’s stored in your WordPress database. Use a strong password and consider a dedicated mailbox for your site.
  • If you send a lot of transactional email, consider using a dedicated email service (like SendGrid) instead, but Office 365 works well for typical WordPress notifications.
  • Monitor your email logs (WP Mail SMTP has a log feature) to see if messages are being sent and if any errors occur.
  • If you change your Office 365 password, update it in the plugin immediately.

Troubleshooting

“SMTP connect() failed” or timeout. Check that your server can reach external SMTP ports – some web hosts block port 587. Try changing the port to 25 (if allowed) or contact your host. Also verify the hostname is exactly smtp.office365.com.

“Username and Password not accepted.” This usually means MFA is enabled. Log into your Microsoft 365 account, go to Security Info, and create an App Password (a 16-character code). Use that as the SMTP password. If MFA is not enabled, double-check the password for typos.

Test email goes to spam. This is almost always a DNS issue. Verify your SPF record includes include:spf.protection.outlook.com and that DKIM is enabled. Use a tool like MXToolbox to check your records.

Emails send but are not received. Check the email log in your plugin. If the log shows success but the recipient doesn’t get it, ask them to check spam. Also ensure your domain isn’t blacklisted.

“Mailer: Non-SMTP” error. Some plugins show this if the SMTP connection fails. Re-enter your settings and save again. If the issue persists, try a different plugin.

Can’t find the SMTP settings. If your plugin uses a different menu structure, search for “SMTP” in the plugin’s documentation – the server values are the same.

Frequently Asked Questions

Do I need a Microsoft 365 business account?

Yes, this guide assumes a paid Microsoft 365 plan. Free Outlook.com accounts have SMTP limitations and are not reliable for WordPress emails.

Can I use port 465 instead of 587?

Office 365 recommends 587 with STARTTLS. Port 465 is not officially supported for SMTP submission, so stick with 587.

What is an app password and why do I need it?

An app password is a separate 16-character code generated in your Microsoft account security settings. It’s required when Multi-Factor Authentication is enabled, because your normal password won’t work for SMTP.

Will this make my WordPress emails more reliable?

Yes. By using authenticated SMTP, your emails are less likely to be flagged as spam, and you’ll get immediate error feedback if something goes wrong.

Do I need to change any code in my theme?

No. The SMTP plugin automatically intercepts WordPress’s mail function, so no code changes are needed.

What if I use a different SMTP plugin?

The server settings (host, port, encryption, authentication) are the same for any plugin. Just enter these values in your chosen plugin’s settings.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →