Soenneker.Validators.Email.Mx
4.0.2722
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Validators.Email.Mx --version 4.0.2722
NuGet\Install-Package Soenneker.Validators.Email.Mx -Version 4.0.2722
<PackageReference Include="Soenneker.Validators.Email.Mx" Version="4.0.2722" />
<PackageVersion Include="Soenneker.Validators.Email.Mx" Version="4.0.2722" />
<PackageReference Include="Soenneker.Validators.Email.Mx" />
paket add Soenneker.Validators.Email.Mx --version 4.0.2722
#r "nuget: Soenneker.Validators.Email.Mx, 4.0.2722"
#:package Soenneker.Validators.Email.Mx@4.0.2722
#addin nuget:?package=Soenneker.Validators.Email.Mx&version=4.0.2722
#tool nuget:?package=Soenneker.Validators.Email.Mx&version=4.0.2722
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 | Versions 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. |
-
net10.0
- Soenneker.DnsClient.Util (>= 4.0.1259)
- Soenneker.Utils.String (>= 4.0.3195)
- Soenneker.Validators.Validator (>= 4.0.738)
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 | 0 | 9/9/2026 |
| 4.0.2731 | 0 | 9/9/2026 |
| 4.0.2730 | 7 | 9/8/2026 |
| 4.0.2729 | 6 | 9/8/2026 |
| 4.0.2728 | 30 | 9/8/2026 |
| 4.0.2727 | 64 | 9/8/2026 |
| 4.0.2726 | 61 | 9/8/2026 |
| 4.0.2724 | 67 | 9/7/2026 |
| 4.0.2723 | 79 | 9/7/2026 |
| 4.0.2722 | 80 | 9/7/2026 |
| 4.0.2721 | 74 | 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 |
Update dependency Soenneker.Utils.String to 4.0.3195 (#3263)