Re: Winsock not listening
Why not just use the ocx control? Or the Winsock API? CreateObject is usually used in scripting.
Re: Winsock not listening
Part of your problem is that you are declaring tcpMailSocket object inside your click routine. When the click routine exits, the tcpMailSocket object goes out of scope and VB releases it, at which time the tcpMailSocket object is obviously closing first.
Suggest either what danecook recommended or declare your tcpMailSocket object at top of your form so it is available to the entire form. If done that way, you will have to call CreateObject once at some point before using it and you should close it and set it to Nothing at some point before your app unloads.
To better understand declarations and their scope, suggest looking at this FAQ topic and others. The VB FAQ main page is linked in my signature below.
Re: Winsock not listening