Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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" wrote in message
oups.com...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to validate email address during data entry in Excel Ramiro Excel Discussion (Misc queries) 1 January 20th 09 08:30 PM
Validate Email address entry Rayasiom Excel Discussion (Misc queries) 2 May 31st 07 10:36 AM
Validate email address Ken Valenti Excel Programming 1 January 24th 06 12:31 AM
Validate an email address BethP Excel Programming 1 July 12th 05 11:51 PM
relative address in validate miro Excel Programming 4 November 30th 04 07:44 AM


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"