IMAP fetch RFC822.SIZE command

Dec 1, 2014 at 3:32 PM

I'm trying to define the size of the mail message, but I cant figure out how to send such command as "fetch RFC822.SIZE" using imap. I know that i can get message size after it downloading, but I dont need to download it. I found ImapClient.ExecuteFecth(long mailindex) method, but i can't understand, what to deal with it.
Dec 1, 2014 at 10:41 PM

Please use GetMessageSizes method of ImapClient object.

Dec 2, 2014 at 8:29 AM
I'm sorry, but I still cant resolve problem. I have format exception when trying
static void GetSize(ImapClient icl, string folder, bool newOnly = true)
            ImapFolder ifolder = icl.SelectFolder(folder);

            SearchResult messageList;
            if (newOnly)
                messageList = icl.ExecuteSearch("UNSEEN UNDELETED");
                messageList = icl.ExecuteSearch("UNDELETED");

            if (messageList.MailIndexList.Count < 1)
                Console.WriteLine("No messages"); return;

            var mssizes = icl.GetMessageSizes(1, 1); -> Here is format exeption, I'm trying GetMessageSizes(0, 0) or GetMessageSizes(1, 4) etc...