ImapExecuteCustomCommand Method |
Namespace: MailBee.ImapMail
Exception | Condition |
---|---|
MailBeeException | An error occurred and ThrowExceptions is true. |
To use this method, the developer should have some knowledge of the IMAP4 protocol.
If commandID is non-empty string and not a null reference, MailBee will send the following request to the server (in C# terms): commandID + " " + command + "\r\n".
If commandID is "" (Empty), the entire request would be "MBNxxxxxxxx" + " " + command + "\r\n" where "xxxxxxxx" is an ordinal number of the issued command since the moment of establishing connection with the server.
If commandID is a null reference, the entire request would be command + "\r\n" (untagged request, also called "command continuation request").
To analyze results of user-defined commands, the developer can use GetServerResponse and GetServerResponses(String) methods.
To check if the server supports the particular extension/capability, the developer can use GetExtension(String) method passing the name of the capability.
// To use the code below, import MailBee namespaces at the top of your code using MailBee; using MailBee.ImapMail; // The actual code (put it into a method of your class) Imap imp = new Imap(); imp.Connect("imap.company.com"); imp.Login("jdoe", "secret"); imp.ExecuteCustomCommand("IDLE", string.Empty); imp.ExecuteCustomCommand("DONE", null); imp.Disconnect();