/// <summary>examines a mailbox.</summary> /// <param name="mailboxName">Name of the mailbox.</param> /// <returns></returns> /// <exception cref="System.Exception"></exception> public ImapMailboxInfo Examine(string mailboxName) { var mailbox = UTF7.EncodeExtendedUTF7(mailboxName); var answer = SendCommand("EXAMINE \"" + mailbox + "\""); if (!answer.Success) { throw new Exception(string.Format("Error at examine mailbox {0}: {1}", mailboxName, answer.Result)); } return(ImapMailboxInfo.FromAnswer(mailboxName, answer)); }
/// <summary>Selects the mailbox with the specified name.</summary> /// <param name="mailboxName">Name of the mailbox.</param> /// <returns></returns> /// <exception cref="System.Exception"></exception> public ImapMailboxInfo Select(string mailboxName) { var mailbox = UTF7.EncodeExtendedUTF7(mailboxName); var answer = SendCommand("SELECT \"{0}\"", mailbox); if (!answer.Success) { throw new Exception(string.Format("Error at select mailbox {0}: {1}", mailboxName, answer.Result)); } SelectedMailbox = ImapMailboxInfo.FromAnswer(mailboxName, answer); return(SelectedMailbox); }