NET Email Validation
BlackList Property
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class : BlackList Property
A List of emails, domains, or words to black list
Syntax
'Declaration
 
Public Property BlackList As System.Collections.Generic.Dictionary(Of String,CompareMethod)
'Usage
 
Dim instance As EmailValidation
Dim value As System.Collections.Generic.Dictionary(Of String,CompareMethod)
 
instance.BlackList = value
 
value = instance.BlackList
public System.Collections.Generic.Dictionary<string,CompareMethod> BlackList {get; set;}
public read-write property BlackList: System.Collections.Generic.Dictionary; 
public function get,set BlackList : System.Collections.Generic.Dictionary
public: __property System.Collections.Generic.Dictionary<string*,CompareMethod>* get_BlackList();
public: __property void set_BlackList( 
   System.Collections.Generic.Dictionary<string*,CompareMethod>* value
);
public:
property System.Collections.Generic.Dictionary<String^,CompareMethod>^ BlackList {
   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";
 
//Black list hotmail.com domain
emailValidator.BlackList.Add("hotmail.com", CompareMethod.DomainName);
 
//Validate a single email that will be black listed
Result myResult = emailValidator.ValidEmail("john.smith@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"
 
'Black list hotmail.com domain
emailValidator.BlackList.Add("hotmail.com", CompareMethod.DomainName)
 
'Validate a single email that will be black listed
Dim myResult As Result = emailValidator.ValidEmail("john.smith@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