Пример #1
0
 public void ImapFullCramMd5Test()
 {
     _connection = new ImapConnect(_stdhost);
     _authentication = new ImapAuthenticate(_connection, _stduser, _stdpass);
     _command = new ImapCommand(_connection);
     _connection.LoginType = LoginType.CRAM_MD5;
     Assert.IsTrue(_connection.Open());
     Assert.IsTrue(_connection.State == ConnectionState.Connected);
     _authentication.Login();
     Assert.IsTrue(_connection.State == ConnectionState.Open);
     _mailbox = _command.Examine("Inbox");
     Assert.IsTrue(_mailbox.Exist != 0);
     _authentication.Logout();
     Assert.IsTrue(_connection.State == ConnectionState.Closed);
     _connection.Close();
     _connection.Dispose();
 }
Пример #2
0
 public void ImapFullSslPlainTest()
 {
     _connection = new ImapConnect(_sslhost, 993, true);
     _authentication = new ImapAuthenticate(_connection, _ssluser, _sslpass);
     _command = new ImapCommand(_connection);
     Assert.IsTrue(_connection.Open());
     Assert.IsTrue(_connection.State == ConnectionState.Connected);
     _connection.LoginType = LoginType.PLAIN;
     _authentication.Login();
     Assert.IsTrue(_connection.State == ConnectionState.Open);
     _mailbox = _command.Examine("Inbox");
     Assert.IsTrue(_mailbox.Exist != 0);
     _authentication.Logout();
     Assert.IsTrue(_connection.State == ConnectionState.Closed);
     _connection.Close();
     _connection.Dispose();
 }