NET Email Validation
EnableLogging(String) Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class > EnableLogging Method : EnableLogging(String) Method
Log to a file
Syntax
'Declaration
 
Public Overloads Function EnableLogging( _
   ByVal filePath As System.String _
) As System.Boolean
'Usage
 
Dim instance As EmailValidation
Dim filePath As System.String
Dim value As System.Boolean
 
value = instance.EnableLogging(filePath)
public System.bool EnableLogging( 
   System.string filePath
)
public function EnableLogging( 
    filePath: System.String
): System.Boolean; 
public function EnableLogging( 
   filePath : System.String
) : System.boolean;
public: System.bool EnableLogging( 
   System.string* filePath
) 
public:
System.bool EnableLogging( 
   System.String^ filePath
) 

Parameters

filePath
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 up a file for logging
string fileName = "c:\\log.txt";
emailValidator.EnableLogging(fileName);
 
//Connect using the best available options
List<ValidationOptions> options = emailValidator.BestConnectionOptions();
Console.WriteLine(emailValidator.BestConnectionMessage);
 
//Validate a single email with the best available options
Result myResult = emailValidator.ValidEmail("john.smith@hotmail.com", options);
 
//Print the results to the console
Console.WriteLine(System.IO.File.ReadAllText(fileName));
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 up a file for logging
Dim fileName As String = "c:\log.txt"
emailValidator.EnableLogging(fileName)
 
'Connect using the best available options
Dim options As List(Of ValidationOptions) = emailValidator.BestConnectionOptions()
Console.WriteLine(emailValidator.BestConnectionMessage)
 
'Validate a single email with the best available options
Dim myResult As Result = emailValidator.ValidEmail("john.smith@hotmail.com", options)
 
'Print the results to the console
Console.WriteLine(System.IO.File.ReadAllText(fileName))
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