Iam working on IMAP, reading mail content I got twice or third times of same mails content.
I had check out different different scenario so I comes to know Response() was gives me repeatitive content.
I am passing Command like this.
byte[] commandBytes = System.Text.Encoding.ASCII.GetBytes(("$ UID FETCH " + index + " (BODY[HEADER.FIELDS (SUBJECT FROM DATE)])" + "\r\n").ToCharArray());
_imapNs.Write(commandBytes, 0, commandBytes.Length);
_imapNs.Flush();
string strMsg = Response();
my member of Stream and TcpClient is.
private TcpClient _imapClient;
private Stream _imapNs;
and my Response method is here.
private string Response()
{
byte[] data = new byte[_imapClient.ReceiveBufferSize];
int ret = _imapNs.Read(data, 0, data.Length);
return Encoding.ASCII.GetString(data);
}
once I had check this complete cycle then I comes to knows the Response() method gives me repeatitive content so is there any solution for that.....
Thanks...!!