Soenneker.Validators.Email.Mx 11.0.2838

Prefix Reserved
dotnet add package Soenneker.Validators.Email.Mx --version 11.0.2838
                    
NuGet\Install-Package Soenneker.Validators.Email.Mx -Version 11.0.2838
                    
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="Soenneker.Validators.Email.Mx" Version="11.0.2838" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Validators.Email.Mx" Version="11.0.2838" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Validators.Email.Mx" />
                    
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 Soenneker.Validators.Email.Mx --version 11.0.2838
                    
#r "nuget: Soenneker.Validators.Email.Mx, 11.0.2838"
                    
#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 Soenneker.Validators.Email.Mx@11.0.2838
                    
#: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=Soenneker.Validators.Email.Mx&version=11.0.2838
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Validators.Email.Mx&version=11.0.2838
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Validators.Email.Mx

Queries DNS for MX records on a domain or on the domain extracted from an email-shaped string.

Install

dotnet add package Soenneker.Validators.Email.Mx

Registration

using Soenneker.Validators.Email.Mx.Registrars;
using Microsoft.Extensions.DependencyInjection;

services.AddEmailMxValidatorAsSingleton();

AddEmailMxValidatorAsScoped() is also available. The scoped validator still reuses the singleton DNS client utility; disposing the scope does not discard that shared DNS client state. The singleton registration uses singleton dependencies throughout.

Query a domain

using Soenneker.Validators.Email.Mx.Abstract;

bool hasMx = await validator.Validate(
    "example.com",
    cancellationToken);

The result is true when the DNS response contains at least one MX answer and false when the response reports an error or contains no MX answers. The method does not validate or normalize domain syntax before querying.

Query an email domain

bool hasMx = await validator.ValidateEmail(
    "person@example.com",
    cancellationToken);

ValidateEmail extracts the text after the last @. It returns false when non-empty text cannot be extracted on both sides, then delegates to the domain query. This is not mailbox syntax validation and does not trim input or normalize internationalized domain names.

What an MX result means

A true result proves only that the resolver returned an MX record. It does not prove that a mailbox exists, accepts mail, or belongs to a user. The validator does not connect to an SMTP server and does not apply the implicit-A/AAAA fallback used by mail delivery when MX records are absent.

DNS response errors are returned as false. Transport failures and cancellation from the DNS client propagate to the caller. DNS answers can change and may be cached by the underlying resolver, so do not persist this result as permanent deliverability state.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.2838 0 11/15/2026
11.0.2836 54 11/11/2026
11.0.2835 47 11/11/2026
11.0.2834 51 11/11/2026
11.0.2833 48 11/11/2026
11.0.2832 48 11/11/2026
11.0.2831 51 11/11/2026
11.0.2828 47 11/11/2026
11.0.2826 106 11/3/2026
11.0.2825 93 11/3/2026
11.0.2824 97 11/3/2026
11.0.2823 94 11/3/2026
11.0.2822 90 11/3/2026
11.0.2821 88 11/3/2026
11.0.2819 94 11/3/2026
11.0.2818 112 10/29/2026
11.0.2817 107 10/27/2026
11.0.2816 101 10/27/2026
11.0.2815 102 10/27/2026
11.0.2814 98 10/27/2026
Loading failed

Update dependency Soenneker.Utils.String to 11.0.3316 (#3380)