public IEnumerable <Mailbox> FetchMailboxes(ImapClient client, string username, string password) { IEnumerable <Mailbox> list = null; string retval = client.LogIn(username, password); if (string.IsNullOrEmpty(retval)) { retval = client.FetchMailboxes(out list); if (string.IsNullOrEmpty(retval)) { list.ToList().Sort(); } } client.LogOut(); if (!string.IsNullOrEmpty(retval)) { throw new Exception(retval); } return(list); }
public IEnumerable<Mailbox> FetchMailboxes(ImapClient client, string username, string password) { IEnumerable<Mailbox> list = null; string retval = client.LogIn(username, password); if (string.IsNullOrEmpty(retval)) { retval = client.FetchMailboxes(out list); if (string.IsNullOrEmpty(retval)) { list.ToList().Sort(); } } client.LogOut(); if (!string.IsNullOrEmpty(retval)) { throw new Exception(retval); } return list; }