here and download mailex.zip It's a POP3/SMTP client but it shows how to use winsock.