To change the currently selected IMAP folder simply use Imap.Select method:
imap.Select("Folder1");
To list all IMAP folders use Imap.GetFolders method:
foreach (FolderInfo folder in imap.GetFolders())
{
string name = folder.Name;
}
You can use CommonFolders class to recognize folders and their purpose:
using (Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("pat@gmail.com", "password");
CommonFolders folders = new CommonFolders(imap.GetFolders());
Console.WriteLine("Inbox folder: " + folders.Inbox.Name);
Console.WriteLine("Sent folder: " + folders.Sent.Name);
Console.WriteLine("Spam folder: " + folders.Spam.Name);
// You can select folders easy:
imap.Select(folders.Inbox);
imap.Select(folders.Sent);
imap.Select(folders.Spam);
imap.Close();
}