Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can window socket functions like send , recv be used to communicate with web servers.


Is it possible for my windows client/server application to communicate with web servers using send and recv functions or any other functions.

I wish to make my windows client/server application to be able to send e-mails using SMTP and also to send SMS.

I now now the stuctured discussion that client carry out when attempting to send e-mails to server. I need to know how to communivate with servers specifically web severs to that I can send e-mails to them.
Posted
Comments
Mohibur Rashid 31-Mar-12 9:03am    
whether it is email server or http server you can use socket programming(i dont know any other communication method either). but you do not need to know http communication to do e-mail client. you only need to know SMTP and relative pop3 or IMAP protocol

To send mails using a SMTP server see RFC 5321 [^] and the Wikipedia [^]. When not using an encrypted connection, this is quite simple. If you don't want to implement it yourself, you may use a SMTP library.

You may also use the Windows MAPI interface [^] to send mails.

Another option is using the Windows Mail interface [^].

Web servers use the HTTP protocol which did not support sending mails. If you want to use a mail form of a specific web page or a web mail server to send mails, you can do that if you know how the mail data are send by emulating the data transfer like a web browser. But this is always specific to the used web service and must be adjusted when the service changes his page or used scripts.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 31-Mar-12 11:46am    
Good answer! 5+
stib_markc 2-Apr-12 6:30am    
5!
All most used Internet protocols are based on sockets, over the same principle, and using a text exchange convention, which is RFC defined. You can use the same socket layer functions for any protocols, and do protocol specifics with data content only (it's a bit more complicated for real serious mail and http clients, but the basic idea is the same).

So if you find a convenient socket based set of functions, or classes, or whatever you want (even your own set of functions, classes, whatever you want), you just have to apply correctly the considered RFC.

Good luck
 
Share this answer
 
Additionally to Jochen Arndt's answer, if you want to use HTTP, take a look at the WinINet[^] API.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900