I built an in-house alternative to Mailgun — standalone PHP endpoints that use Microsoft Graph SDKs to subscribe to a shared mailbox and maintain threaded email conversations over the organization’s own Microsoft 365 channel. Programmatic, threaded email, with no third-party transactional-email service.
Transactional Email Without the Middleman
Sending and tracking threaded email programmatically usually means paying a service like Mailgun and routing company mail through a third party. We already had Microsoft 365 — the question was whether we could get the same threaded, programmatic capability directly off our own shared mailbox instead.
What I Delivered

Standalone PHP endpoints
Built self-contained PHP endpoints — no third-party email service in the loop.

Microsoft Graph subscription
Used Microsoft Graph SDKs to subscribe to a shared mailbox and react to mail events.

Threaded conversations
Maintained real threaded conversations over the email channel, not one-off sends.

On our own M365 channel
Kept everything on the organization’s own Microsoft 365 mail, fully in-house.
Skills & Tools
The stack behind this build — tap any to see related work.
The Impact
A working in-house transactional-email service — PHP endpoints subscribed to a shared mailbox via Microsoft Graph, maintaining threaded conversations — delivering what a paid service would, on infrastructure we already own.
Own the Channel You Already Pay For
Paying a third party to send email you could send yourself is a subscription hiding in plain sight. Building the endpoints on Microsoft Graph turned our existing mailbox into a programmatic, threaded email service — no middleman, no recurring bill.
Image credits: “Michał Frąckowiak – Office computers” by Michał Frąckowiak (CC BY-SA 2.0)


