public RegisterUntaggedHandler ( string atom, ImapUntaggedHandler handler ) : void | ||
atom | string | The atom token. |
handler | ImapUntaggedHandler | The handler. |
return | void |
using MailKit.Net.Imap; using MailKit.Search; // Create a new ImapClient using (var client = new ImapClient ()) { // Connect to the IMAP server client.Connect ("imap.server.com", 993, true); // Authenticate with the server client.Authenticate ("username", "password"); // Register an untagged handler to process any IDLE responses client.RegisterUntaggedHandler ("IDLE", (s, e) => { // Do something with the IDLE response }); // Enable the IDLE command client.Inbox.Open (FolderAccess.ReadOnly); client.Inbox.Idle (); }
using MailKit.Net.Imap; // Create a new ImapClient using (var client = new ImapClient ()) { // Connect to the IMAP server client.Connect ("imap.server.com", 993, true); // Authenticate with the server client.Authenticate ("username", "password"); // Register an untagged handler to process any CAPABILITY responses client.RegisterUntaggedHandler ("CAPABILITY", (s, e) => { // Do something with the CAPABILITY response }); // Send the CAPABILITY command to the server client.SendCommand ("CAPABILITY"); }This example registers an untagged handler for processing CAPABILITY responses from the IMAP server. It connects to the server, authenticates with the credentials provided, and then sends the CAPABILITY command to the server. Once the server responds with the capability list, the untagged response handler will be called to process the capability list. In conclusion, MailKit.Net.Imap package library provides support for connecting to an IMAP server, and ImapCommand.RegisterUntaggedHandler is a method that can be used to register an event handler for processing untagged responses received from the server.
public RegisterUntaggedHandler ( string atom, ImapUntaggedHandler handler ) : void | ||
atom | string | The atom token. |
handler | ImapUntaggedHandler | The handler. |
return | void |