Lesnikowski.Pawel.Mail.Pop3.Pop3.Send C# (CSharp) Method

Send() private method

private Send ( string command ) : void
command string
return void
        private void Send(string command)
        {
            // add CRLF to the message
            command+="\r\n";

            // convert message buffer to array of chars
            byte[] buffer=Encoding.ASCII.GetBytes(command.ToCharArray());

            // send buffer
            int bytesSent=socket.Send(buffer,buffer.Length, 0);

            if (bytesSent!=buffer.Length)
                throw new Exception("failed to send request to server");
        }