Here are some simple examples for using aspNetMX
[ C# ]
using System; using aspNetMX; namespace test { class Class1 { [STAThread] static void Main(string[] args) { MXValidate mx = new MXValidate(); //log the session mx.LogInMemory = true; //set the email address string EmailAddress = "test@hotmail.com"; //validate MXValidateLevel level = mx.Validate( EmailAddress , MXValidateLevel.Mailbox ); if( level == MXValidateLevel.Mailbox) { Console.WriteLine( "Valid Email Address"); } else { Console.WriteLine( "Not Valid Email Address"); } Console.WriteLine( "Here is the session log"); Console.WriteLine( mx.GetLog() ); Console.ReadLine(); } } }
[ Visual Basic ]
Imports aspNetMX Module Module1 Sub Main() Dim mx As MXValidate = New MXValidate() 'log the session mx.LogInMemory = True 'set the email address Dim EmailAddress As String = "test@hotmail.com" 'validate Dim level As MXValidateLevel = mx.Validate(EmailAddress, MXValidateLevel.Mailbox) If level = MXValidateLevel.Mailbox Then Console.WriteLine("Valid Email Address") Else Console.WriteLine("Not Valid Email Address") End If Console.WriteLine("Here is the session log") Console.WriteLine(mx.GetLog()) Console.ReadLine() End Sub End Module
Copyright 2002 - Contact: Webmaster Last Updated: Tuesday, August 24, 2010