Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GetMessages()
- {
- SetUpConnection();
- var inbox = client.Inbox;
- inbox.Open(FolderAccess.ReadOnly);
- var folders = client.GetFolder(client.PersonalNamespaces[0]);
- System.Diagnostics.Debug.WriteLine("Folder test {0}", folders.Count);
- foreach(var folder in folders.GetSubfolders())
- {
- foreach(var subFolder in folder.GetSubfolders())
- {
- if (subFolder.Name.Equals("Вся почта") || subFolder.Name.Equals("All Mail"))
- {
- subFolder.Open(FolderAccess.ReadOnly);
- for (int i = subFolder.Count - 1; i > subFolder.Count - 20; i--)
- {
- System.Diagnostics.Debug.WriteLine("Subject: " + subFolder.GetMessage(i).Subject);
- System.Diagnostics.Debug.WriteLine("TextBody: " + subFolder.GetMessage(i).TextBody);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment