Using a login and password to authenticate

var client = new ImapClient("imap.gmail.com", true);

if(client.Connect()) {
     
     if(client.Login("address@gmail.com", "password")) {
          // login successful
     }
}
else {
     // connection not successful
}