Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SMTP verification of Email addresses
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00886871
Message ID:
00886934
Views:
20
>Hi there,
>
>Anyone know if it is possible in VFP to use SMTP verification of domains and or Email addresses without sending anything to the user, just to check the validity.
>
>Need to follow up users where Email addresses are not valid and would like to do this in VFP. Any info about similar projects or sucesses would be greatly appreciated.
>
>Regards,
>
>Simon

You can call the mail server, discuss a little with it and quit when you have your response.

The basic idea is to start a socket session with the server on the port 25 (SMTP)
and interact with the server until you get a response '250' (known address).

To get there, you need to:
- start the dialog with the server
- loop until the server stop sending '220' msg lines
- Say hello: "HELO [servername]"+< CRLF >
- test if the response start with '250' or quit (error)
- start a fake send session: "MAIL FROM ''"+< CRLF >
- test if the response start with '250' or quit (error)
- try to enter the tested address: "RCPT TO: [testaddress]"+< CRLF >
- test if the response start with '250' or '251' - if yes, the address is ok, otherwise it's not a good one
- send : "QUIT"

The MX record: The real tricky part (not exposed here) is to get the mail server address
(because it's hardly the name after the '@') and port (not always 25).

You can try experiment on a telnet session interactively to see what happen during an SMTP connection...
Simply start the command prompt and type : telnet servername port
like this:
c:\> telnet smtp.microsoft.com 25
The RFC 821 is a good source of info for this topic.

May be somebody have already writen this kind of program, but not me :-)
Good luck!
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform