Simple email pop3/smtp source - I get a bind error



I need to check the headers fo my email using smtp/pop3

When bind'ing to a mail server I get bind error:

....
h=gethostbyname("mail.whatever.fi");
service.sin_addr.s_addr=inet_addr(inet_ntoa(*((struct in_addr *)h->h_addr)));
service.sin_port=htons(110);
if (bind(mylistens, (SOCKADDR*)&service, sizeof(service)) == SOCKET_ERROR)
{
blah blah error here
....

I must be doing something wrong. Other FTP/TCP connection go well.

If someone has a very simple C source SMTP/POP3 receive client example I'd
appreciate it.
.



Relevant Pages