?
Solved

Check e-mail address?

Posted on 2004-04-22
6
Medium Priority
?
149 Views
Last Modified: 2010-05-02
Hi all
Does anyone has a function/sub in VB to check an email address is good or bad?

Thanks.
0
Comment
Question by:melodiesoflife
5 Comments
 
LVL 18

Accepted Solution

by:
Sethi earned 300 total points
ID: 10887757
0
 
LVL 5

Expert Comment

by:Xentor_
ID: 10887758
If you're looking to verify if it's in the traditional user@dom.ain format, that's easy enough... But if you want to know if it's an actual working address, you'll have to actually send something to it.

To verify the format, I would do an Instr search to find the @, iterate through the part before it to check for alphanumeric only, then split the other part by periods (.) and check for alphanumerics and dashes surrounded by alphanumerics.
0
 
LVL 5

Expert Comment

by:Xentor_
ID: 10887769
Hmm, looking at Sethi's comment, it's nice to be proven wrong.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10887841
YOu have to correct the sysntaxes:

function checkemail(strEmail) as boolean
    If Len(strEMail) < 5 Exit function                              ' Minimum length check
    If InStr(strMail, "@", 1) = 1 Exit function                  ' Must contain @ symbol
    If InStr(strMail, ".", 1) = 1 Exit function                    ' Must contain . symbol

    checkemail = true
end function
0
 
LVL 6

Author Comment

by:melodiesoflife
ID: 10895742
Thank all.

I have wrote it for myself
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question