Results 1 to 3 of 3

Thread: e-mail format function?

  1. #1

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    Hi,

    does someone know if there's a function in VB that recognizes if a given text is an email?

    i.e. something like

    IsEmail("[email protected]") = true

    and

    IsEmail("hello@world") = false

    ...just wandering.

    Thanks!

    W.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  2. #2
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Talking Use Instr

    Just make a function like this:
    Code:
    Public Function CheckEMail (sEmail as String) as Boolean
       Dim i as Integer
       i = Instr(1, sEmail, "@")
       If i > 0 then CheckEMail = True Else CheckEmail = False
    End Function
    Call it with this:

    Code:
    If CheckEmail("[email protected]" Then
    Good Luck
    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  3. #3

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    Hehehe thanks that is already similar to what I'm doing , also using filters such as .com, .net, .org ...

    Thanks anyway! Anyone has other ideas?
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width