| Visual Basic (Declaration) | |
|---|---|
Public Enum ImapStatus Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapStatus | |
| C# | |
|---|---|
public enum ImapStatus : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
__value public enum ImapStatus : public System.Enum | |
| C++/CLI | |
|---|---|
public enum class ImapStatus : public System.Enum | |
| Member | Description |
|---|---|
| Bad | 3 Error. Indicates that the command was not properly formed (ex. the command syntax was incorrect). Otherwise, this response is considered a protocol-level error or server failure. |
| Bye | 5 Shutdown. Indicates the server is about to close the connection to the client. This can occur during logout, inactivity, or as a server warning. |
| No | 2 Failure. Indicates a unsuccessful command completion. Otherwise, this response is considered a warning. |
| None | 0 No status information was returned. |
| Ok | 1 Success. Indicates a successful command completion. Otherwise, this response is informative. Success can vary in meaning depending on the command executed. For example, a COPY operation (Mailbox.Copy) will return an OK response even when no messages could be copied. Review the behavior of the operation in question for further details. |
| PreAuth | 4 Preauthorization. Through some external mechanism, authentication has occurred without a login, and no login command is necessary. |
The following example demonstrates sending a NOOP command and checking the response.
| Visual Basic | Copy Code |
|---|---|
' Login to the mail server Imap1.Login(Server, User, Pass) ' Send a NOOP command Dim Response As ImapResponse = Imap1.Noop() ' Check the response If Response.Status = ImapStatus.Ok Then Debug.WriteLine("Good response from server") Else Debug.WriteLine("Response from server: " + Response.Status) End ' Logout Imap1.Logout() | |
| C# | Copy Code |
|---|---|
// Login to the mail server imap1.Login(server, user, pass); // Send a NOOP command ImapResponse response = imap1.Noop(); // Check the response if(response.Status == ImapStatus.Ok) Debug.WriteLine("Good response from server"); else Debug.WriteLine("Response from server: " + response.Status); // Logout imap1.Logout(); | |
The ImapStatus enumeration indicates the status of a response from the IMAP server. Not all responses provide status. Typically, status responses come at the completion of a command execution. Whether an ImapResponse object contains status information is indicated by the ImapResponse.ResponseType property, in which case it will return ImapResponseType.Status. The status itself is exposed by the ImapResponse.Status property of the ImapResponse object.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.ImapStatus
Target Platforms: Microsoft .NET Framework 2.0