ChatAIze.PerfectEmail 0.2.4

dotnet add package ChatAIze.PerfectEmail --version 0.2.4                
NuGet\Install-Package ChatAIze.PerfectEmail -Version 0.2.4                
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="ChatAIze.PerfectEmail" Version="0.2.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChatAIze.PerfectEmail --version 0.2.4                
#r "nuget: ChatAIze.PerfectEmail, 0.2.4"                
#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.
// Install ChatAIze.PerfectEmail as a Cake Addin
#addin nuget:?package=ChatAIze.PerfectEmail&version=0.2.4

// Install ChatAIze.PerfectEmail as a Cake Tool
#tool nuget:?package=ChatAIze.PerfectEmail&version=0.2.4                

Perfect Email

An easy-to-use, high-performance email validator for C# .NET 9.0 with custom attribute and disposable domain detection.

Installation

.NET CLI

dotnet add package ChatAIze.PerfectEmail

Package Manager Console

Install-Package ChatAIze.PerfectEmail

Usage

using ChatAIze.PerfectEmail;

bool isValidEmail = EmailValidator.IsValidEmail("someone@example.com");
Console.WriteLine(isValidEmail); // true

bool isDisposableEmail = DisposableEmailDetector.IsDisposableEmail("someone@0-mail.com");
Console.WriteLine(isDisposableEmail); // true

bool isDisposableEmailDomain = DisposableEmailDetector.IsDisposableEmailDomain("0-mail.com");
Console.WriteLine(isDisposableEmailDomain); // true

Attribute Usage

The Email attribute performs address validation when the model is submitted. However, it does not check for disposable domains. An HTTP 400 Bad Request status code is returned by default.

using ChatAIze.PerfectEmail;

namespace ChatAIze.ExampleAPI.Models;

public record AccountCreationRequest
{
    [Email]
    public required string Email { get; init; }

    public required string Password { get; init; }
}
using ChatAIze.ExampleAPI.Models;
using Microsoft.AspNetCore.Mvc;

namespace ChatAIze.ExampleAPI.Controllers;

[ApiController]
[Route("api/[controller]")]
public sealed class AccountsController : ControllerBase
{
    [HttpPost]
    public IActionResult CreateAccount(AccountCreationRequest request)
    {
        Console.WriteLine($"Creating account for {request.Email}");
        return NoContent();
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

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
0.2.4 86 12/6/2024
0.2.3 114 11/17/2024
0.2.2 117 11/13/2024
0.2.1 250 10/8/2024
0.2.0 121 9/30/2024
0.1.1 132 8/27/2024
0.1.0 211 3/30/2024