Am not able to fetch data from different folders like sent mail, drafts, trash etc.
Code:
Imap imaplog = new Imap();
imaplog.ConnectSSL(hostAddrs, portAddrs);
imaplog.UseBestLogin(userID, Pwd);
CommonFolders common = new CommonFolders(imaplog.GetFolders());
imaplog.Select(common.Sent);
long uid;
List<long> uids;
uids = imaplog.Search(Flag.Recent);
uids.Reverse();
uids = uids.Take(5).ToList();
mailSent = new string[uids.Count][];
for (int i = 0; i < uids.Count; i++)
{
uid = uids[i];
var eml = imaplog.GetMessageByUID(uid);
imaplog.MarkMessageSeenByUID(uid);
IMail email = new MailBuilder().CreateFromEml(eml);
mailSent[i] = new string[4]
{
email.Text,
email.Subject,
email.To.ToString(),
email.Date.ToString()
};
}
imaplog.Close();