Trapping winsock errors

Brendon
02-08-2002, 02:15 AM
Is there a way to trap winsock errors? I am currently using codes similar to this website (http://www.vbip.com/winsock/winsock_mail_checker_01.asp). If I were to setthe state of a variable and attempt to connect to the server, how can I trap errors like:
1) Invalid host?
2) Invalid login name?
3) Invalid password?

If the pop servers were to shut down halfway through, would there be an error?

Thanks for any help
Brendon

divil
02-08-2002, 02:28 AM
The Winsock control raises an Error event.

Brendon
02-08-2002, 02:30 AM
Originally posted by divil
The Winsock control raises an Error event.

Thanks!

Brendon
02-08-2002, 03:00 AM
If the server stops sending data, will the winsock raise an error?

Flyguy
02-08-2002, 05:23 AM
You have to use the .RequestTimeout setting.

Squirm
02-08-2002, 06:55 AM
In regards to detecting POP3 errors, you merely have to check the first word of the incoming string. If this is +OK then it means some action has completed successfully. If the first word is -ERR then it means an error occured, like so:

+OK User name accepted, password please
-ERR Bad login

The bad login error is given if an incorrect username or password is given. :)

Brendon
02-13-2002, 06:52 PM
Thanks a lot people! I am so glad to be in this forum. Hope I will be experts like all of you and start contributing soon!:D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum