+ Reply to Thread
Results 1 to 2 of 2

Validate an Email Address

  1. #1
    Duncan
    Guest

    Validate an Email Address

    Hi Guys,

    I wondered if it was possible to design a simple form with one textbox
    and a submit button that would validate an email address put in the
    textbox to see if it was a correct email address. (i dont mean the
    syntax/format, but actually a real email address)

    I have seen an article on how to do it in PHP
    (http://www.sitepoint.com/article/use...il-address-php) but I would
    prefer to do it through a userform

    Does anyone know if this is possible?

    Duncan


  2. #2
    AMDRIT
    Guest

    Re: Validate an Email Address

    take a look at dnsstuff.org. You could possible simulate a form post and
    read the response via xmlHttp.

    Otherwise, you could simulate the handshake with a given SMTP server and
    perform the whois.

    have a look at http://www.vbip.com/winsock-api/ to get you started on
    implementing winsock.

    sample flow

    1. validate smtp address format

    2. perform DNS Lookup of the domain to see if it exists
    3. perform MX Lookup of the domain to see if it has a mailexchanger exposed
    (get the one with the lowest meteric)

    4.
    (
    connect to the MX server
    issue a Helo [<"Domain you are talking to">]
    read response if 250 then issue a MAIL FROM: <"someemailaddress">
    read response if 250 then issue a RCPT TO:
    <"email_address_you_are_testing">
    read response if 250 then
    email address exists, or the server is not telling us
    else
    email address doesn't exist
    issue Quit
    close connection
    )

    Using an api winsock will make deployment easier then requiring the winsock
    control to be install on target machines. Using API have risks that you
    should be aware of. First, improper calls can crash you application and
    cause data loss or they can provide you with a nice BSOD with a
    unitelligable GPF.

    Error handling is your friend, comment your code (because if you do, it
    forces you to rationalize what you are doing to maintain focus.) Remeber,
    with API's, if you issue an open of some sort, you should call the
    appropriate close routine when you are done. API's do not have "auto
    cleanup".

    Sockets are asynchronous by design, once you issue a command, you will not
    have immediate feedback and will therefore be blocking until a response is
    returned. Not all bad SMTP response codes are bad, and perhaps you should
    issue the command again to try for a positive response.

    HTH

    "Duncan" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Guys,
    >
    > I wondered if it was possible to design a simple form with one textbox
    > and a submit button that would validate an email address put in the
    > textbox to see if it was a correct email address. (i dont mean the
    > syntax/format, but actually a real email address)
    >
    > I have seen an article on how to do it in PHP
    > (http://www.sitepoint.com/article/use...il-address-php) but I would
    > prefer to do it through a userform
    >
    > Does anyone know if this is possible?
    >
    > Duncan
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1