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

Receive() public méthode

Receives a response from the server.
public Receive ( bool processStatusUpdatesAutomatically = true ) : ImapResponseReader
processStatusUpdatesAutomatically bool
Résultat ImapResponseReader
        public ImapResponseReader Receive(bool processStatusUpdatesAutomatically = true)
        {
            var reader = new ImapResponseReader(this);
            reader.ReadNextLine();
            if (processStatusUpdatesAutomatically) {
                CheckForStatusUpdates(reader);
            }
            return reader;
        }

Usage Example

        private bool AuthenticateLogin(NetworkCredential credentials)
        {
            var text    = string.Format("LOGIN {0} {1}", credentials.UserName, credentials.Password);
            var command = new ImapCommand(text);
            var reader  = _client.SendAndReceive(command);

            while (!reader.IsCompleted)
            {
                reader = _client.Receive(false);
            }
            return(reader.IsOk);
        }