NET Email Validation
ValidEmail(String,String) Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class > ValidEmail Method : ValidEmail(String,String) Method
Validate an email and an associated contact id using the DefaultOptions (see the DefaultOptions property)
Syntax
'Declaration
 
Public Overloads Function ValidEmail( _
   ByVal contactId As System.String, _
   ByVal emailAddress As System.String _
) As Result
'Usage
 
Dim instance As EmailValidation
Dim contactId As System.String
Dim emailAddress As System.String
Dim value As Result
 
value = instance.ValidEmail(contactId, emailAddress)
public Result ValidEmail( 
   System.string contactId,
   System.string emailAddress
)
public function ValidEmail( 
    contactId: System.String;
    emailAddress: System.String
): Result; 
public function ValidEmail( 
   contactId : System.String,
   emailAddress : System.String
) : Result;
public: Result* ValidEmail( 
   System.string* contactId,
   System.string* emailAddress
) 
public:
Result^ ValidEmail( 
   System.String^ contactId,
   System.String^ emailAddress
) 

Parameters

contactId
emailAddress
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";
 
Result myResult= emailValidator.ValidEmail("1", "johnsmith@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"
 
Dim myResult As Result= emailValidator.ValidEmail("1", "johnsmith@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
Overload List