Hi Pavel,
Thanks for your input. But it would be grateful if you can help me with this piece of code. What I am trying to do is to retrieve one email Content by MessageUID but It is not working. I don't want to retrieve all the USEEN emails , so I am just trying to pass the MessageUID in second search command to get the content of just 1 email at a time. But Most of the times UID sent comes with 0 count results. Would you please suggest any improvement is required in this code or any other solution that just give me the 1 unread email
Nabeel
Thanks for your input. But it would be grateful if you can help me with this piece of code. What I am trying to do is to retrieve one email Content by MessageUID but It is not working. I don't want to retrieve all the USEEN emails , so I am just trying to pass the MessageUID in second search command to get the content of just 1 email at a time. But Most of the times UID sent comes with 0 count results. Would you please suggest any improvement is required in this code or any other solution that just give me the 1 unread email
ImapX.FolderCollection folders = client.Folders;
ImapX.MessageCollection messages = client.Folders["INBOX"].Search("UNSEEN",false);
for (int i = 0; i < messages.Count; i++)
{
ImapX.MessageCollection messageDetails = client.Folders["INBOX"].Search("MessageUid" + messages[i].MessageUid, true);
.................................. Rest of the code Goes here ........................
}
RegardsNabeel