Crystalbyte.Equinox.Imap.ImapClient.Select C# (CSharp) Method

Select() public method

The SELECT command selects a mailbox so that messages in the mailbox can be accessed. http://tools.ietf.org/html/rfc3501#section-6.3.1
public Select ( string mailboxName ) : SelectExamineImapResponse
mailboxName string The name of the mailbox to select.
return SelectExamineImapResponse
        public SelectExamineImapResponse Select(string mailboxName)
        {
            // we need to convert non ASCII names according to IMAP specs.
            // http://tools.ietf.org/html/rfc2060#section-5.1.3
            var name = MailboxNameEncoder.Encode(mailboxName);

            var text = string.Format("SELECT \"{0}\"", name);
            var command = new ImapCommand(text);
            var reader = SendAndReceive(command, false);

            var response = new SelectExamineImapResponse(mailboxName);
            response.Parse(reader);

            if (response.IsOk) {
                SelectedMailbox = mailboxName;
            }

            return response;
        }

Usage Example

Ejemplo n.º 1
0
        public void ThreadStart()
        {
            _clientIdle = AccountController.CreateClientByAccount(AccountController.Account);
            Thread.Sleep(1000);

            _clientIdle.StatusUpdateReceived += OnStatusUpdateReceived;
            _clientIdle.Select("INBOX");
            _clientIdle.StartIdle();
        }
All Usage Examples Of Crystalbyte.Equinox.Imap.ImapClient::Select