#include<winsock2.h>
void sockettext()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2,0),&wsaData);
SOCKET sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
SOCKADDR_IN sa;
sa.sin_family=AF_INET;
sa.sin_port=htons(IPPORT_SMTP);
sa.sin_addr.S_un.S_addr=inet_addr("123.58.178.203");
if(connect(sock,(SOCKADDR *)&sa,sizeof(sa))==SOCKET_ERROR)
{
MessageBox(NULL,TEXT("连接失败"),TEXT("错误"),MB_OK); ;
}
TCHAR buff[256];
ZeroMemory(buff,sizeof(buff)/sizeof(TCHAR));
recv(sock,buff,sizeof(buff)/sizeof(TCHAR),0);
MessageBox(NULL,buff,TEXT("返回消息"),MB_OK);
closesocket(sock);
WSACleanup();
}