Simple Email Address Validation |
using System; using Neev Software.ASPNET.Components ; namespace EmailValidatorDemo { /// <summary> /// Summary description for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { try { EmailAddressValidator e = new EmailAddressValidator(); e.DnsServer = "69.50.184.85"; e.SmtpFromEmail = "yourcompany@yourcompany.com"; e.SmtpFromDomain = "mail.yourcompany.com"; e.UseMXCach = true; e.Validate("yourname@company.com"); Console.WriteLine("Server: {0}", e.SmtpTranscript ); Console.ReadLine(); } catch(Exception ex) { Console.WriteLine("Server: {0}",ex.ToString() ); Console.ReadLine(); } } } }
Imports System; Imports Neev Software.ASPNET.Components ; module EmailValidatorDemo sub Main() try Dim EmailAddressValidator = new EmailAddressValidator() e.DnsServer = "69.50.184.85" e.SmtpFromEmail = "yourcompany@yourcompany.com" e.SmtpFromDomain = "mail.yourcompany.com" e.UseMXCach = true e.Validate("yourname@company.com") Console.WriteLine("Server: {0}", e.SmtpTranscript ) Console.ReadLine(); catch Exception ex Console.WriteLine("Server: {0}", ex.ToString() ) Console.ReadLine() end try end sub end module