o365-sendmail The Laravel Office 365 Mail Transport

o365-sendmail

Introduction

o365-sendmail is a Laravel Office 365 mail transport that makes it easy to deliver email via Office 365 Mail Service. The mail transport is an API based that is built on top of Microsoft Graph API.

The API based drivers are often simpler and faster than sending mail via SMTP servers.

Background

For many years, applications have used Basic authentication to connect to servers, services, and API endpoints. Basic authentication simply means the application sends a username and password with every request, and those credentials are also often stored or saved on the device.

Basic authentication is an outdated industry standard. Basic authentication makes it easier for attackers to capture user credentials (particularly if the credentials are not protected by TLS), which increases the risk of those stolen credentials being reused against other endpoints or services.

With these threats and risks in mind, Microsoft took steps to improve data security in Exchange Online by removing the ability to use Basic authentication in Exchange Online for Exchange ActiveSync (EAS), POP, IMAP, Remote PowerShell, Exchange Web Services (EWS), Offline Address Book (OAB), Autodiscover, Outlook for Windows, and Outlook for Mac. They further disabled SMTP AUTH in all tenants where it wasn't being used.

SMTP AUTH is still available after Microsoft permanently disabled Basic authentication on October 1, 2022. The reason SMTP is still available is that many multi-function devices such as printers and scanners can't be updated to use modern authentication.

However, Microsoft strongly encourages moving from apps that use Basic authentication to apps that use Modern authentication (OAuth 2.0 token-based authorization). Microsoft further recommends other options for sending authenticated mail including using alternative protocols, such as the Microsoft Graph API. This is the motive for the development of this mail transport

Next steps

Want to learn a bit more before diving in? Check out the Microsoft Graph API page. Or, if you're ready to get started, jump right into the Microsoft Entra application creation and configuration instructions.

Code highlighting provided by Torchlight