|
-
Jan 5th, 2000, 01:18 AM
#1
Thread Starter
Hyperactive Member
Question:
I have an app that validates an email address. If you enter [email protected], it should validate whether or not the address is in proper format. That's fine and dandy.
However, what if I wanted to make sure the domain is not a bogus one? Is it possible to ping the mail server itself?
Thanks
------------------
CompuGEEK
-
Jan 5th, 2000, 01:34 AM
#2
You can attempt to connect to the Mail Server using the Winsock Control, if it's Successful, you've verified the Domain, otherwise, you can't be sure it's valid, ie.
Code:
Private Sub Command1_Click()
Winsock1.Connect "mail." & Mid$(Text1, InStr(Text1, "@") + 1), 25
End Sub
Private Sub Winsock1_Connect()
MsgBox "Email Domain Verified"
Winsock1.Close
Winsock1.RemotePort = 0
Winsock1.LocalPort = 0
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
If InStr(LCase(Description), "host not found") Then
MsgBox "Unable to Validate Email Domain"
End If
Winsock1.Close
Winsock1.RemotePort = 0
Winsock1.LocalPort = 0
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 5th, 2000, 04:58 AM
#3
Thread Starter
Hyperactive Member
Aaron,
Thank you very much! I appreciate all your help.
------------------
CompuGEEK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|