Validate an Email Address

  • Thread starter Thread starter John Wright
  • Start date Start date
J

John Wright

I want to validate an email address against our Exchange server. Anyone
have code or point me in the right direction?


John
 
I want to validate an email address against our Exchange server. Anyone
have code or point me in the right direction?

John

If you're not meaning domain validation, but format validation of mail
address, you can use Regex pattern to check if it's a valid e-mail
address:

'-----Begin-------
Imports System.Text.RegularExpressions

Dim pattern As String
' I hope pattern is proper
pattern = "\w+([-+.]\w)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
If Regex.IsMatch("mail_here", pattern) = True Then
MsgBox("Valid mail address!")
Else
MsgBox("Invalid mail address!")
End If
'-----End-------


Hope this helps,

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Email Bounce Error 3
Outlook Bypass Validation of E-Mails - Outlook 2016 0
AOL email scam 2
SQL Validation 1
Validate Password against Domain Policy 0
Unsolicited Emails 12
Best Email & Web hosting 4
Export email addresses 1

Back
Top