Tumgik
#MailKitEmailSender
ryadel · 4 years
Text
ASP.NET Core C# - Send email messages via SMTP with MailKit
Tumblr media
In this article I will briefly explain how to implement the IEMailSender interface using MailKit, which will allow any ASP.NET Web Application to send e-mail messages using any SMTP server. For those who don't know what the IEmailSender interface and MailKit are, here's a brief explanation to better understand what are we talking about: The IEmailSender interface is a set of ASP.NET native API that fully supports the ASP.NET Core Identity default UI infrastructure: such interface can be implemented by creating a custom EMailSender class that can be used within the Web Application to asynchronously send e-mail message in a structured, transparent and consistent way. For additional info, check out the IEmailSender interface official documentation and/or the Microsoft.AspNetCore.Identity.UI.Services namespace reference. MailKit is an Open Source cross-platform .NET mail-client library based on MimeKit and optimized for mobile devices that allows to connect to SMTP server and send e-mail messages: for further details about it, check out its product page on NuGet. In a nutshell, what we're about to do is to implement the IEmailSender interface using MailKit, so that we can use the native infrastructure to seamlessly send e-mail messages through the SMTP server of our choice. Are we ready? Let's start! 1. Installing MailKit The first thing we need to do is to install the MailKit NuGet package, which can be done in the following ways: Using the .NET Read the full article
0 notes
ryadel · 4 years
Text
ASP.NET Core C# - Send email messages with SendInBlue and MailKit
Tumblr media
A few days ago we've published a guide explaining how to send email messages via SMTP with MailKit implementing a custom MailKitEmailSender class based upon the ASP.NET Core built-in IEmailSender interface. In this post we'll make use of that custom class to see how we can create a free account on SendInBlue.com and send transactional e-mail messages using their SMTP. For those who don't know what we're talking about, SendInBlue is a all-in-one SAAS-based platform that offers transactional services such as Email, SMS, Chat (and more) through a versatile set of APIs that can be invoked and consumed from external websites or web services; its feature set makes it rather similar to SendGrid, Mailgun, Amazon SES and the likes, at least when it comes to e-mail sending capabilities. DISCLAIMER: This website is not affiliated with SendInBlue; this article represents the free opinion of the author and has not been commissioned or sponsored in any way. 1. Create an Account The first thing we need to do is to create an account to SendInBlue.com: doing it is extremely easy, we just have to fill up the required fields (or select a third-party OAuth provider such as Google), as shown in the following screenshot: Once done, we need to select one of the various pricing plan available: the best thing we can do, at least for the time being, is to select the FREE plan, which allows to send up to 300 e-mail messages per day; that's more than enough for testing out our implementation. Read the full article
0 notes