EnterpriseEmailValidator 1.0.3
dotnet add package EnterpriseEmailValidator --version 1.0.3
NuGet\Install-Package EnterpriseEmailValidator -Version 1.0.3
<PackageReference Include="EnterpriseEmailValidator" Version="1.0.3" />
<PackageVersion Include="EnterpriseEmailValidator" Version="1.0.3" />
<PackageReference Include="EnterpriseEmailValidator" />
paket add EnterpriseEmailValidator --version 1.0.3
#r "nuget: EnterpriseEmailValidator, 1.0.3"
#:package EnterpriseEmailValidator@1.0.3
#addin nuget:?package=EnterpriseEmailValidator&version=1.0.3
#tool nuget:?package=EnterpriseEmailValidator&version=1.0.3
📧 EmailValidator
Lightweight, high-performance email validation library for .NET.
This package validates email addresses using:
- ✔ RFC-compliant syntax validation
- ✔ IDN (International Domain Name) support
- ✔ MX record lookup (via DnsClient)
- ✔ A-record fallback check
- ✔ Role-based email detection
- ✔ Thread-safe mail server caching
Designed for backend services, APIs, SaaS platforms, and enterprise systems that need reliable email validation beyond simple regex checks.
✨ Features
1️⃣ Syntax Validation
- RFC-compliant email format validation
- Local-part length enforcement (max 64 chars)
- Domain length enforcement (max 255 chars)
- Unicode domain normalization using
IdnMapping
2️⃣ Role-Based Email Detection
Prevents use of common role-based addresses such as:
admin@support@info@sales@contact@billing@postmaster@webmaster@noreply@security@
3️⃣ Mail Server Verification
Uses DnsClient to verify that the domain can receive email:
- MX record lookup
- A record fallback if no MX exists
- Thread-safe caching of lookup results
- Configured DNS timeout and retry control
4️⃣ Thread-Safe Performance
Uses
ConcurrentDictionaryfor DNS cachingDNS client configured with:
- 5-second timeout
- 1 retry
- Internal DNS caching enabled
Safe for high-concurrency environments
📦 Installation
dotnet add package EmailValidator
🛠 Basic Usage
string reason;
if (EmailValidator.Core.EmailValidator.IsValid("admin@example.com", out reason))
{
Console.WriteLine("Valid email");
}
else
{
Console.WriteLine("Invalid: " + reason);
}
🔍 Validation Flow
The validator performs checks in this order:
- Empty check
- Syntax validation (RFC + IDN normalization)
- Role-based account detection
- DNS MX lookup
- A-record fallback
If any check fails, validation stops immediately and returns a failure reason.
📊 Example Failure Reasons
Email is emptyInvalid email formatRole-based email addressDomain does not accept mail
⚠ Important Notes
- DNS-based validation does NOT guarantee mailbox existence.
- Some domains accept all mail (catch-all configuration).
- Port 25 SMTP probing is NOT performed.
- Validation depends on DNS availability.
- Some providers may temporarily block frequent DNS queries.
🏢 Designed For
- SaaS platforms
- Enterprise APIs
- User registration systems
- Account verification workflows
- CRM systems
- Lead validation pipelines
📦 Dependencies
DnsClient
📝 License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Caching.Memory (>= 10.0.3)
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 |
|---|