Glossary Item Box
Use the Email Validation for .NET product to validate email addresses in Windows and Web applications. With little effort, both single addresses and lists of addresses can be validated using seven different levels of strictness. Topics covered in this overview:
Levels of Validation
Syntax. The most basic validation level is the Syntax check. The address is matched against a regular expression pattern that can be customized, if desired.
BlackList. The next level of validation is the user-kept blacklist. Any address found in the blacklist is immediately rejected. The blacklist can include addresses with wildcards (for example, to reject entire domains).
WhiteList. The whitelist is similar to the blacklist, in that it prevents further validation checks on an email address. However, addresses in the whitelist are immediately accepted as valid. Wildcards can also be used in items added to this list (for example, for domains that always return positive replies, even for bad addresses).
GreenList. The greenlist is similar to the whitelist, except that it is dynamically updated by the component. If a test account is specified, it will be tried as the first account against any server. If the server responds positively, the domain is added to the list. Any email addresses using this domain will then be automatically validated, without further communication with the server.
DnsLookup. The component connects to the specified DNS server(s), and discovers if any host mail servers are listed for the email address.
SmtpConnect. A connection to the mail server(s) returned from the DNS lookup is attempted.
SmtpRecipient. Upon connecting to the mail server, the component asks the server if the email address is a recipient on the server.
Configuring DNS
The Validator component uses a fully configurable class to resolve mail servers associated with an email address. Configurable options include:
The Dns class also includes a Dns.Trace event for debugging purposes.
Configuring SMTP
The Validator component uses a fully configurable class to query SMTP servers for their recipients. Configurable options include:
The SmtpTester class also includes a Tcp.Trace event for debugging purposes.
Time-Saving Features
Email validation can be a time-intensive process, as it involves communicating with first, DNS servers, and then SMTP servers. Many times SMTP servers will purposefully delay responses, adding to the total length of the process. The Validator component has a number of features designed to speed up the process of validating email lists as much as possible.
Domain Cache. The user has the option of utilizing a domain cache. When an email address's domain is resolved, the result is added to the cache. The cache is examined prior to any DNS query, preventing unnecessary repeat lookups. DomainCacheTimeout dictates the expiry period for entries in the cache.
Shared SMTP Connection. All email addresses in the list with the same domain are tested together, and on the same connection, preventing costly re-connects.
GreenList. The user has the option of utilizing the greenlist. When TestAccount is set, the first recipient test with an SMTP server is for the bogus test account. If the server returns a positive response, it is an indication that the server responds positively to any recipient query. The server is added to the greenlist, and all future addresses hosted by the server are validated at the GreenList level.
Progress
Track progress of email validation with the Validator.Progress event. The event will fire as validation of each address completes. With VerboseProgress set, the event fires for each step in the process.
This covers most of the basics. Please read on for more detail.
Send comments on this topic.
Documentation version 1.0.3.0.
© 2008 Dart Communications. All rights reserved.