NET Email Validation
MaxThreads Property
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class : MaxThreads Property
The maximum number of threads to use to validate emails simultaneously
Syntax
'Declaration
 
Public Property MaxThreads As System.Integer
'Usage
 
Dim instance As EmailValidation
Dim value As System.Integer
 
instance.MaxThreads = value
 
value = instance.MaxThreads
public System.int MaxThreads {get; set;}
public read-write property MaxThreads: System.Integer; 
public function get,set MaxThreads : System.int
public: __property System.int get_MaxThreads();
public: __property void set_MaxThreads( 
   System.int value
);
public:
property System.int MaxThreads {
   System.int get();
   void set (    System.int 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";
 
//Set the maximum threads to a low number (minimum is # of processors)
emailValidator.MaxThreads=5;
 
//Create a list of 100 email addresses
List<string> emailAddresses = new List<string>();
 
for (int i = 1; i <= 100; i++)
    emailAddresses.Add(string.Format("johnsmith{0}@hotmail.com", i));
 
//Begin asynchronous validation
emailValidator.ValidateListAsync(emailAddresses);
 
while (emailValidator.IsBusy)
{
    Console.WriteLine(string.Format("{0} of {1}", emailValidator.EmailsProcessed,emailValidator.TotalEmailsToProcess));
 
    //Sleep 1 second
    System.Threading.Thread.Sleep(1000);
}
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"
 
'Set the maximum threads to a low number (minimum is # of processors)
emailValidator.MaxThreads=5
 
'Create a list of 100 email addresses
Dim emailAddresses As List(Of String) = New List(Of String)()
 
For i As Integer = 1 To 100
    emailAddresses.Add(String.Format("johnsmith{0}@hotmail.com", i))
Next i
 
'Begin asynchronous validation
emailValidator.ValidateListAsync(emailAddresses)
 
Do While emailValidator.IsBusy
    Console.WriteLine(String.Format("{0} of {1}", emailValidator.EmailsProcessed,emailValidator.TotalEmailsToProcess))
 
    'Sleep 1 second
    System.Threading.Thread.Sleep(1000)
Loop
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