NET Email Validation
WhiteList Property
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class : WhiteList Property
A list of emails, domains, or words to white list
Syntax
'Declaration
 
Public Property WhiteList As System.Collections.Generic.Dictionary(Of String,CompareMethod)
'Usage
 
Dim instance As EmailValidation
Dim value As System.Collections.Generic.Dictionary(Of String,CompareMethod)
 
instance.WhiteList = value
 
value = instance.WhiteList
public System.Collections.Generic.Dictionary<string,CompareMethod> WhiteList {get; set;}
public read-write property WhiteList: System.Collections.Generic.Dictionary; 
public function get,set WhiteList : System.Collections.Generic.Dictionary
public: __property System.Collections.Generic.Dictionary<string*,CompareMethod>* get_WhiteList();
public: __property void set_WhiteList( 
   System.Collections.Generic.Dictionary<string*,CompareMethod>* value
);
public:
property System.Collections.Generic.Dictionary<String^,CompareMethod>^ WhiteList {
   System.Collections.Generic.Dictionary<String^,CompareMethod>^ get();
   void set (    System.Collections.Generic.Dictionary<String^,CompareMethod>^ value);
}
Example
EmailValidation emailValidator = new EmailValidation(); //Trial Mode
//EmailValidation emailValidator = new EmailValidation("place user name here", "place license key here"); //License Mode
     
emailValidator.FromEmail = "someone@somewhere.com";
emailValidator.FromMailServer = "mail.somewhere.com";
 
emailValidator.WhiteList.Add("hotmail.com", CompareMethod.DomainName);
 
//This fake email will be valid since the domain is white listed
Result myResult = emailValidator.ValidEmail("asdf@hotmail.com");
 
//Print the results to the console
Console.WriteLine(myResult.UserMessage);
Console.WriteLine();
Console.WriteLine(myResult.StatusDescription);
Console.WriteLine();
Console.WriteLine(myResult.Log);
Dim emailValidator As EmailValidation = New EmailValidation() 'Trial Mode
'Dim emailValidator As EmailValidation = New EmailValidation("place user name here", "place license key here") 'License Mode
 
emailValidator.FromEmail = "someone@somewhere.com"
emailValidator.FromMailServer = "mail.somewhere.com"
 
emailValidator.WhiteList.Add("hotmail.com", CompareMethod.DomainName)
 
'This fake email will be valid since the domain is white listed
Dim myResult As Result = emailValidator.ValidEmail("asdf@hotmail.com")
 
'Print the results to the console
Console.WriteLine(myResult.UserMessage)
Console.WriteLine()
Console.WriteLine(myResult.StatusDescription)
Console.WriteLine()
Console.WriteLine(myResult.Log)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EmailValidation Class
EmailValidation Members