示例#1
0
        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);
        }
示例#2
0
        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;
        }