| Kelvin Silva (3) | |||
|
http://stackoverflow.com/questions/14421748/winsock-string-formatting apppend \n to tell the server that you pressed enter.... my problem is, when sending DATA command and typing in the message when sending the DATA message i need to type in multiple lines and whenever i press enter it actually sends stuff over the socket instead of it being formatted?
| |||
|
Last edited on
|
|||
| coder777 (2549) | |
|
There's no problem sending only parts of the data. What you need is an indicator for the end (and maybe the begin, depends on the intensity of the communication) of the message. it is anyway likely that the server gets the message in portions. | |
|
|
|
| Kelvin Silva (3) | |
|
Can you elaborate more? Do i have to send recv function everytime i contact with the smtp server during DATA send command? | |
|
|
|
| coder777 (2549) | |||
|
Sorry, I overlooked the smtp part. See: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
the end indicator is "\r\n.\r\n"after that you may call recv(). if recv() is blocking you must not call it before the end. if not you need to call it until the answer arrives
| |||
|
|
|||
| modoran (1245) | |
|
For any serious programming I recommend you to use libcurl instead of this (unless you really want to learn how things works): http://curl.haxx.se/ | |
|
|
|
| Kelvin Silva (3) | |
|
That was the pronlem.. i was calling recv during data transmission. How would one write a client that deals with this? Any aimple telnet open source clients available? | |
|
|
|