Send & Receive Issues

Fix Microsoft 365 SMTP Email Delivery from PHP

Anum MushtaqAnum Mushtaq Nov 20, 2026 868 views

Question details

A user needs to restore email delivery from a PHP application using Microsoft 365 SMTP.

Fix Microsoft 365 SMTP Email Delivery from PHP
Product
Microsoft 365 Exchange Online SMTP
Device & OS
not provided
Scenario
A PHP application sends email through smtp.office365.com.
Observed behavior
The application may generate a Message-ID, but email is not delivered.
Before you start

Identify the Microsoft 365 mailbox used by the PHP application and locate its SMTP settings and error logs. Make sure you can access the Microsoft 365 admin center or ask an administrator to check the mailbox and message trace.

Solution 1Recommended

Verify Microsoft 365 SMTP submission settings

Use this solution to check the server, encryption, authentication, and mailbox permissions used by the PHP application.

1
Check the SMTP connection

Open the application's mail configuration and set the SMTP host to smtp.office365.com, the port to 587, and encryption to STARTTLS.

2
Review authentication

Check the SMTP authentication settings in your PHP mail library. Use a supported authentication method, such as OAuth, and verify that the application has the required Microsoft 365 permissions.

3
Check SMTP AUTH

In the Microsoft 365 admin center, open Users > Active users, select the mailbox, and check Mail > Manage email apps for Authenticated SMTP. Also ask an administrator to check organization-wide SMTP AUTH settings and authentication policies.

4
Verify the sending address

Compare the From address in the PHP application with the authenticated mailbox. If they differ, verify that the account has permission to send as the selected address.

Authentication policies matter: Security defaults or authentication policies can block SMTP AUTH even when it is enabled for a mailbox. A generated Message-ID alone does not prove that Microsoft 365 accepted or delivered the message.
Free Microsoft Office alternative

Use WPS Office for Everyday Office Files

WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for easier migration. It does not resolve Microsoft 365 SMTP server or PHP email delivery issues.

Work with Microsoft Word, Excel, and PowerPoint file formats, including DOCX, XLSX, and PPTX.Use a familiar interface to open and edit existing Office files.Keep documents and spreadsheets used alongside email workflows in one lightweight office suite.Start using core office tools for free.
microsoft office alternative - wps office

Frequently Asked Questions

Does a Message-ID mean Microsoft 365 delivered the email?

No. A PHP application can generate a Message-ID before the message is accepted. Check the SMTP response and search Mail flow > Message trace in the Exchange admin center.

Which SMTP settings should my PHP application use?

For Microsoft 365 client SMTP submission, configure smtp.office365.com on port 587 with STARTTLS and a supported authentication method.

Where can I check whether SMTP AUTH is enabled for a mailbox?

In the Microsoft 365 admin center, go to Users > Active users, select the mailbox, and check Mail > Manage email apps for Authenticated SMTP. Organization settings and authentication policies can also affect access.

What should I do if the PHP server cannot connect on port 587?

Check outbound firewall rules on the application server and network, then contact your hosting provider or internet provider to determine whether port 587 is blocked.

Why can the mailbox sign in but the application still fail to send?

Web sign-in does not confirm that SMTP AUTH is available or that the PHP application has valid authentication and sender permissions. Check the mail library's SMTP error output and the mailbox's email app settings.