ChatAIze.PerfectEmail 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ChatAIze.PerfectEmail --version 0.2.0                
NuGet\Install-Package ChatAIze.PerfectEmail -Version 0.2.0                
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.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ChatAIze.PerfectEmail --version 0.2.0                
#r "nuget: ChatAIze.PerfectEmail, 0.2.0"                
#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.0

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

Perfect Email

An easy-to-use, high-performance email validator for C# .NET 8.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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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.3 96 11/17/2024
0.2.2 102 11/13/2024
0.2.1 219 10/8/2024
0.2.0 111 9/30/2024
0.1.1 122 8/27/2024
0.1.0 207 3/30/2024