EmailKit.AspNetCore 1.0.2

dotnet add package EmailKit.AspNetCore --version 1.0.2
                    
NuGet\Install-Package EmailKit.AspNetCore -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EmailKit.AspNetCore" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EmailKit.AspNetCore" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="EmailKit.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EmailKit.AspNetCore --version 1.0.2
                    
#r "nuget: EmailKit.AspNetCore, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EmailKit.AspNetCore@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EmailKit.AspNetCore&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=EmailKit.AspNetCore&version=1.0.2
                    
Install as a Cake Tool

πŸ“§ AspNetCore.EmailKit

AspNetCore.EmailKit is a lightweight yet powerful email service kit designed for ASP.NET Core applications.
It allows you to send emails securely and effortlessly by defining SMTP settings in appsettings.json and calling a single line of code.


πŸš€ Features

  • Simple setup (single service integration)
  • IOptions pattern support with appsettings.json
  • Automatic configuration via IServiceCollection extension
  • Built-in ILogger for success and error logging
  • Secure SMTP with TLS/SSL support
  • Send email in one line β€” await _emailService.SendEmailAsync(...)

πŸ“¦ Installation

Install via NuGet:

dotnet add package AspNetCore.EmailKit

Appsettings.json Configuration

"EmailSettings": {
  "SmtpServer": "smtp.gmail.com",
  "SmtpPort": 587,
  "SenderName": "MyApp Mail Service",
  "SenderEmail": "noreply@myapp.com",
  "UserName": "noreply@myapp.com",
  "Password": "app_specific_password"
}

Note: If you’re using Gmail, you must enable 2-Step Verification and create an App Password.
Go to: Google Account β†’ Security β†’ App Passwords β†’ Create New.

Integration in Program.cs / Startup.cs

using AspNetCore.EmailKit.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Register EmailKit
builder.Services.AddEmailKit(builder.Configuration);

var app = builder.Build();

app.Run();

Usage Example

using AspNetCore.EmailKit.Interface;

public class AccountController : ControllerBase
{
    private readonly IEmailService _emailService;

    public AccountController(IEmailService emailService)
    {
        _emailService = emailService;
    }

    [HttpPost("send-confirmation")]
    public async Task<IActionResult> SendConfirmationMail(string email)
    {
        await _emailService.SendEmailAsync(
            toEmail: email,
            subject: "Email Confirmation",
            body: "<h2>Click below to confirm your account</h2>"
        );

        return Ok("Confirmation email sent successfully.");
    }
}

Error Handling & Logging

[Information] Email sent successfully: test@domain.com / Welcome [Error] Error while sending email: Authentication failed.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 370 11/11/2025
1.0.1 298 11/10/2025