SMTP - Outlook Basic Auth deprecation - alternatives?

Vote:
 

Hi.

On CMS 11, using host smtp.office365.com in mailSettings and with the deprecation of basic auth, what would be alternatives be, except using SendGrid?

Like Stefan Holm's article is there a way in CMS 11 (ASP.NET Framwork) to use my own EmailService that also works with the built-in messaging, such as forgot password, and notifications?!

#341709
Feb 16, 2026 13:44
Vote:
 

Yes, you can replace the default SMTP behavior in CMS 11 without relying on SendGrid.

In Optimizely CMS 11 (ASP.NET Framework), built-in messaging (forgot password, notifications, etc.) goes through the EPiServer mail abstraction. You can implement your own ISmtpClient (or override the mail service) and register it via DI.

This allows you to:

  • Use OAuth2-based SMTP authentication

  • Integrate with Microsoft Graph API instead of SMTP

  • Route mail through an internal relay

As long as your custom implementation is registered in the container, the built-in messaging features will use it automatically.

The key is to replace the mail implementation - not just the <mailSettings> configuration. That’s typically the cleanest way to handle basic auth deprecation in CMS 11 environments.

#341724
Edited, Feb 16, 2026 21:34
Vote:
 

Hi Jonas

Are you referring to the internal emails that the CMS sends out? Or the mails that the website sends out, as well?

In CMS 11, I believe you can create your own implementation of ISmtpClient. Sort of like the CMS 12 example I wrote about. But slightly different, as CMS 11 does not use MimeKit for emails.

Then you should be able to assign your implementation to the SmtpClientFactory.StaticFactory property. Or maybe you can intercept the SmtpClientFactory class with DI to set instanceFactory on creation.

#341771
Feb 23, 2026 7:16
Vote:
 

Thanks @Keshav and @Stefan Intercepting SmtpClientFactory is the way I am after for having freedom for my own implementation. Thanks!

#341784
Feb 25, 2026 12:42
Vote:
 

Great to hear, Jonas.

Since you are going to send mails through Outlook 365, I can recommend using the MS Graph SDK instead of SMTP. It is less "chatty" than SMTP this way.

#341786
Feb 25, 2026 13:00
Jonas Boman - Feb 25, 2026 13:01
Yes, that is the plan, actually :)
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.