Soenneker.Validators.Email.Mx 4.0.2733

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Validators.Email.Mx --version 4.0.2733
                    
NuGet\Install-Package Soenneker.Validators.Email.Mx -Version 4.0.2733
                    
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="4.0.2733" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Validators.Email.Mx" Version="4.0.2733" />
                    
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 4.0.2733
                    
#r "nuget: Soenneker.Validators.Email.Mx, 4.0.2733"
                    
#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@4.0.2733
                    
#: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=4.0.2733
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Validators.Email.Mx&version=4.0.2733
                    
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 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
4.0.2734 0 9/9/2026
4.0.2733 0 9/9/2026
4.0.2732 29 9/9/2026
4.0.2731 32 9/9/2026
4.0.2730 38 9/8/2026
4.0.2729 39 9/8/2026
4.0.2728 35 9/8/2026
4.0.2727 64 9/8/2026
4.0.2726 63 9/8/2026
4.0.2724 67 9/7/2026
4.0.2723 79 9/7/2026
4.0.2722 81 9/7/2026
4.0.2721 77 9/7/2026
4.0.2720 90 9/5/2026
4.0.2719 79 9/5/2026
4.0.2718 88 9/5/2026
4.0.2717 80 9/4/2026
4.0.2715 82 9/4/2026
4.0.2714 71 9/4/2026
4.0.2713 76 9/4/2026
Loading failed

Updated Multiple NuGet packages