Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hey Guys,

I am just wondering why

telnet mail.someserver.com 110
+OK MAILSERVER ready.

Ends on a new line as if it is expecting a user response, but when I use

C#
//Send
mySocket.Send(myByte);

//Recive
Byte[] bRecive = new byte[1024];
int i = mySocket.Receive(bRecive, bRecive.Length, 0);
string sBuffer = Encoding.ASCII.GetString(bRecive);


The response is
telnet localhost 110
+OK ready.


should I send some kind of terminator or line break \r\n when I expect a user input because my app crashes when I enter a keystroke.

Thanks
Posted
Comments
voloda2 25-Sep-10 6:32am    
If you are implementing POP3 yourself, why don't you use appropriate RFC?

1 solution

you can try this->

//send

byte[] data = Encoding.ASCII.GetBytes(message);
soc.Send(data);

//receive

byte[] data1 = new byte[1024];
int p = soc.Receive(data1);
message = "";
message = Encoding.ASCII.GetString(data1, 0, p);
 
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