Crystalbyte.Equinox.Imap.ImapClient.Unsubscribe C# (CSharp) Méthode

Unsubscribe() public méthode

The UNSUBSCRIBE command removes the specified mailbox name from the server's set of "active" or "subscribed" mailboxes as returned by the LSUB command. http://tools.ietf.org/html/rfc3501#section-6.3.7
public Unsubscribe ( string mailboxName ) : ImapResponse
mailboxName string The name of the mailbox to subscribe to.
Résultat ImapResponse
        public ImapResponse Unsubscribe(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("UNSUBSCRIBE \"{0}\"", name);
            var command = new ImapCommand(text);
            var reader = SendAndReceive(command);

            var response = new ImapResponse();
            response.Parse(reader);
            return response;
        }