Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

TCP command to search the uid list

$
0
0

Hi,

I want to download the mail of gmail using imap .

I use system.net.security.Able to download the mails by their UIDs.

The code is as follows

.......................................................................................................

System.Net.Sockets.TcpClient tcpc =new System.Net.Sockets.TcpClient("imap.gmail.com", 993);;

System.Net.Security.SslStream ssl=new System.Net.Security.SslStream(tcpc.GetStream());

ssl.AuthenticateAsClient("imap.gmail.com");
            receiveResponse("");
            receiveResponse("$ LOGIN " +  "123@gmail.com" + " " +"passwrd"+ "  \r\n");


            receiveResponse("$ LIST " + "\"\"" + " \"*\"" + "\r\n");

            receiveResponse("$ SELECT INBOX\r\n");
            receiveResponse("$ STATUS INBOX (MESSAGES)\r\n");           
            receiveResponse("$ UID FETCH " + "<UID> body[text]\r\n");

----------------------------------------------------------------------------

To search the date wise uid list I use the command

$ UID SEARCH SINCE 27-Nov-2012 NOT BEFORE 23-may-2013\r\n

and to get the list of uids grater than some uid number I have the command

$ search UID X:*\r\n

but there is need to combine both the commands .

I want the uid list grater than number x and also apply date filter.So any one knows the search command

to get the result.

Thanks in advance.........


Viewing all articles
Browse latest Browse all 31927

Trending Articles