NET Email Validation
ValidateList(Dictionary<String,String>,List<ValidationOptions>) Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class > ValidateList Method : ValidateList(Dictionary<String,String>,List<ValidationOptions>) Method
Validate a list of emails synchronously with an associated contact id from your database
Syntax
'Declaration
 
Public Overloads Function ValidateList( _
   ByVal contactIdAndEmail As System.Collections.Generic.Dictionary(Of String,String), _
   ByVal options As System.Collections.Generic.List(Of ValidationOptions) _
) As System.Collections.Generic.List(Of Result)
'Usage
 
Dim instance As EmailValidation
Dim contactIdAndEmail As System.Collections.Generic.Dictionary(Of String,String)
Dim options As System.Collections.Generic.List(Of ValidationOptions)
Dim value As System.Collections.Generic.List(Of Result)
 
value = instance.ValidateList(contactIdAndEmail, options)
public System.Collections.Generic.List<Result> ValidateList( 
   System.Collections.Generic.Dictionary<string,string> contactIdAndEmail,
   System.Collections.Generic.List<ValidationOptions> options
)
public function ValidateList( 
    contactIdAndEmail: System.Collections.Generic.Dictionary;
    options: System.Collections.Generic.List
): System.Collections.Generic.List; 
public function ValidateList( 
   contactIdAndEmail : System.Collections.Generic.Dictionary,
   options : System.Collections.Generic.List
) : System.Collections.Generic.List;
public: System.Collections.Generic.List<Result*>* ValidateList( 
   System.Collections.Generic.Dictionary<string*,string*>* contactIdAndEmail,
   System.Collections.Generic.List<ValidationOptions>* options
) 
public:
System.Collections.Generic.List<Result^>^ ValidateList( 
   System.Collections.Generic.Dictionary<String^,String^>^ contactIdAndEmail,
   System.Collections.Generic.List<ValidationOptions>^ options
) 

Parameters

contactIdAndEmail
options
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";
 
//Create a list of 100 email addresses with an id
Dictionary<string, string> emailAddresses = new Dictionary<string, string>();
 
for (int i = 1; i <= 100; i++)
    emailAddresses.Add(i.ToString(), string.Format("johnsmith{0}@hotmail.com", i));
 
//Best connection options
List<ValidationOptions> options = emailValidator.BestConnectionOptions();
 
//Validate a list synchronously
List<Result> results= emailValidator.ValidateList(emailAddresses, options);
 
//Print out the log
foreach (Result myResult in results)
{
    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"
 
'Create a list of 100 email addresses with an id
Dim emailAddresses As Dictionary(Of String, String) = New Dictionary(Of String, String)()
 
For i As Integer = 1 To 100
    emailAddresses.Add(i.ToString(), String.Format("johnsmith{0}@hotmail.com", i))
Next i
 
'Best connection options
Dim options As List(Of ValidationOptions) = emailValidator.BestConnectionOptions()
 
'Validate a list synchronously
Dim results As List(Of Result)= emailValidator.ValidateList(emailAddresses, options)
 
'Print out the log
For Each myResult As Result In results
    Console.WriteLine(myResult.Log)
Next myResult
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
Overload List