It is a .Net library which helps you to send emails from your .Net project
Currently, the library is using Mailjet to send emails. You need to have an active Mailjet account to use this library.
You should have a "MailJetSettings" section in appsettings.json file, which contains three main configurations:
- mailJetApiKey
- mailJetApiSecret
- senderEmail
Add the following code in your Startup file
services.AddScoped<EmailSenderManager>();
- Inject the class EmailSenderManager in your controller
- Create cshtml email template in your assembly
- Call sending email function
await _emailSender.SendEmail(new EmailModel
{
TemplateName = {FULL_Template_Name_Including_Namespace},
Title = {TITLE},
Attachments = {ATTACHMENTS},
EmailReceivers = {[RECEIVERS_EMAILS]}
}, model);