I am working on C# MailClient and which is follow IMAP Protocol, but I am getting wrong response that means the response will give me some repeatative resul. Like say first time I am sending command like this.
byte[] commandBytes = System.Text.Encoding.ASCII.GetBytes(("$ UID FETCH " + index + " (BODY[HEADER.FIELDS (SUBJECT FROM DATE)])\r\n").ToCharArray());
and second time I am sending like this.
byte[] commandBytes = System.Text.Encoding.ASCII.GetBytes(("$ UID FETCH " + index + " (BODYSTRUCTURE)" + "\r\n").ToCharArray());
so I am getting again first command result in twice or more than 2 times; and some times it's continue giving me first result.
my Response() method is like this.
private string Response()
{
byte[] data = new byte[_imapClient.ReceiveBufferSize];
int ret = _imapNs.Read(data, 0, data.Length);
return Encoding.ASCII.GetString(data);
}
Where I am wrong correct me thanks..