RamsonDevelopers.UtilEmail is a .NET class library that provides functionality to send emails using custom credentials. It utilizes the EmailConfig class to store and retrieve email configuration settings.
To use RamsonDevelopers.UtilEmail in your project, follow these steps:
-
Download the RamsonDevelopers.UtilEmail source code or add it as a NuGet package to your solution.
-
Add a reference to the AddEmailService() Method in RamsonDevelopers.UtilEmail project or the installed NuGet package in your target project's program.cs.
IConfiguration configuration = builder.Configuration;
var emailConfig = configuration.GetSection(EmailConfig.SectionLabel);
builder.Services.Configure<EmailConfig>(emailConfig);
builder.Services.AddEmailService();To send emails using RamsonDevelopers.UtilEmail, follow these steps:
-
inside your
appsettings.jsonadd the following section with your actual credentials"MailConfiguration": { "Server" : "your-email-server", "Port" : 25, "UserName" : "your-username", "Password" : "your-password", "UseSsl" : true, "TargetName" : "your-target-name", "FromName" : "your-sender-name", "FromAddress" : "your-sender-address", "ReplyToAddress" : "your-reply-to-address" }
-
Create an instance of SendEmailRequest class and configure appropriate values
-
Create an instance of IEmailService through dependency injection.
-
Invoke
SendEMailAsyncMethod inside theEmailServiceand pass the request object.
RamsonDevelopers.UtilEmail was developed by Ayush Aher and is maintained by Ramson Developers. We would like to acknowledge the contributions of the open-source community and express our gratitude to all the contributors who helped make this project possible.
If you have any feedback, please reach out to us at [email protected] or Raise a Issue in Github Repository