A high-performance .NET library for validating disposable/temporary email domains. Uses aggressive inlining and Span<T> for optimal performance with zero allocations. Built on the comprehensive domain list from disposable/disposable project. Key Features: - High-performance validation using Span<T> and aggressive inlining - Memory efficient with zero allocations for common operations - Regular updates from disposable/disposable domain list - Simple API for validating both emails and domains - Zero external dependencies
$ dotnet add package Disposable.Email![]()
A high-performance .NET library for validating disposable/temporary email domains. Built with performance and efficiency in mind, it provides a simple way to check if an email address or domain is from a known disposable email provider.
The Disposable library offers:
Span<T> and aggressive inlining for optimal performanceInstall the Disposable package:
dotnet add package Disposable
using Disposable;
// Check an email address
bool isDisposable = EmailValidator.IsDisposable("user@tempmail.com");
// Check a domain directly
bool isDomainDisposable = DomainValidator.IsDisposable("tempmail.com");
The EmailValidator class provides methods to validate if an email address uses a disposable domain:
// Using string
bool result1 = EmailValidator.IsDisposable("user@example.com");
// Using ReadOnlySpan<char> for better performance
ReadOnlySpan<char> email = "user@example.com";
bool result2 = EmailValidator.IsDisposable(email);
The DomainValidator class allows direct domain checking:
// Using string
bool result1 = DomainValidator.IsDisposable("example.com");
// Using ReadOnlySpan<char> for better performance
ReadOnlySpan<char> domain = "example.com";
bool result2 = DomainValidator.IsDisposable(domain);
ReadOnlySpan<char> to minimize allocationsMethodImplOptions.AggressiveInliningThe disposable domain list is generated from the disposable/disposable project, specifically using their domains.txt file. This ensures the library stays current with the latest known disposable email providers.
This library is available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and feature requests, please open an issue in the GitHub repository.
Thank you for using Disposable. We look forward to seeing how you use it in your projects!