Home > Software design >  Which library to use for sending email in c#?
Which library to use for sending email in c#?

Time:03-30

I am learning c# .I want to send an autogenerated email to user.

Initially, I thought of using System.Net.Mail for that, but while checking under SMTPClient Page Microsoft doc had mentioned to use Mailkit library instead.

So, I am confused whether to implement using System.net.mail or using open source library like Mailkit..and what is the difference between them. Could anyone pls explain in detail. Or need to use both of them while code implementation.

Note: My application uses C# (.Net framework 4.8)

CodePudding user response:

System.Net.Mail has been deprecated and you should use the recomendation from Microsoft: Mailkit

Also read: https://docs.microsoft.com/pt-br/dotnet/api/system.net.mail.smtpclient?view=net-6.0

We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead. For more information, see SmtpClient shouldn't be used on GitHub.

CodePudding user response:

Some Options you can use: (just check the supported versions)

  1. FluentEmail - Seems to be the better option for sending emails easily, link here (it can also integrate and Send emails with the MailKit Library)

  2. MailKit - If you need more in depth emails then use MailKit instead, link here

  • Related