Open Closed

SmtpClient shouldn't be used #3846


User avatar
0
cfd000 created
  • ABP Framework version: v6.0.0
  • UI type: MVC / Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

According to Microsoft documentation, System.Net.Mail.SmtpClient is obsolete and should not be used.

  • https://github.com/dotnet/platform-compat/blob/master/docs/DE0005.md
  • https://github.com/dotnet/dotnet-api-docs/issues/2986
  • https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-6.0

Additionally, Office 365 is going to disable basic authentication for SMTP as of December 31, 2022. https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

All of the documentation indicates that MailKit https://github.com/jstedfast/MailKit is now the recommended solution.

I did not see a way to use OAuth2 with MailKit using the ABP module. Is there any sample code that demonstrates how to do this?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    -1
    malik.masis created

    Hi,

    Could you have a look at this related documentation, please?

    Regards.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    -2
    cfd000 created

    That does not answer the question at all. It is VERY frustrating that each time we open a ticket, the first response is to link to some generic documentation page. Did you actually read the question?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Currently we have Smtp Sender. We'll consider this topic and plan to make alternative implementations.

    If you wish, you can implement your own email sending logic via implementing IEmailSender interface. After replacing that service with your own implementation, the entire application & modules will use your implementation.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.