| Visual Basic (Declaration) | |
|---|---|
Public Enum ImapCode Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapCode | |
| C# | |
|---|---|
public enum ImapCode : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
__value public enum ImapCode : public System.Enum | |
| C++/CLI | |
|---|---|
public enum class ImapCode : public System.Enum | |
| Member | Description |
|---|---|
| Alert | 1 The response contains an alert which must be shown to the user. This also causes the Imap.Alert event to be raised. |
| BadCharset | 2 The response denotes a SEARCH operation failed due to an unsupported charset. |
| Capability | 3 The response contains a list of IMAP server capabilities. This type of response is also used to populate the Imap.Capabilities collection. |
| NewName | 4 The response denotes an operation failed because the Mailbox was renamed. |
| None | 0 No response code was provided. |
| Parse | 5 The response denotes an error occurred during the parsing of message headers. |
| PermanentFlags | 6 The response contains a list of all flags that can be changed permanently within the mailbox and its messages. Any flags not on this list should not be set. A value of “\*” means new, non-standard flags can be created. |
| ReadOnly | 7 The response denotes the selected mailbox is read-only. |
| ReadWrite | 8 The response denotes the selected mailbox is read-write. |
| TryCreate | 9 The response denotes an executing command failed because the target mailbox does not exist. This response code is returned as a hint to the client that the target mailbox should perhaps be created prior to issuing the command that failed. |
| UidNext | 10 The response includes the UIDNEXT value for the selected mailbox, indicating what the UID of the next created message will be. |
| UidValidity | 11 The response includes the UIDVALIDITY value for the selected mailbox. This value can be used in combination with message UIDs to identify messages uniquely between sessions. |
| Unseen | 12 The response code of the response includes the number (position id) of the first unseen message in the selected mailbox. |
The following example demonstrates using the LineReceived event to detect UIDVALIDITY codes.
| Visual Basic | Copy Code |
|---|---|
Private Sub DoSomething() ' Log in. The Imap.LineReceived event will be raised when data is received Imap1.Login(Server, User, Pass) ' Send a NOOP Imap1.Noop() ' Log out Imap1.Logout() End Sub Private Sub Imap1_LineReceived(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapResponseEventArgs) Handles Imap1.LineReceived Dim Response As ImapResponse ' Iterate through all responses. For Each Response In e.Responses ' Check if it contained a UIDVALIDITY response. If Response.Code = ImapCode.UidValidity Then Debug.WriteLine("UIDVALIDITY is " + Response.CodeValue); End IF Next End Sub | |
| C# | Copy Code |
|---|---|
private void DoSomething() { // Log in. The Imap.LineReceived event will be raised when data is received imap1.Login(Server, User, Pass); // Send a NOOP imap1.Noop(); // Log out imap1.Logout(); } private void imap1_LineReceived(object sender, Dart.PowerTCP.Mail.ImapResponseEventArgs e) { // Iterate through all responses. foreach(ImapResponse response in e.Responses) { // Check if it contained a UIDVALIDITY response. if(response.Code == ImapCode.UidValidity) Debug.WriteLine("UIDVALIDITY is " + response.CodeValue); } } | |
Enumerated type used to represent the response code returned by the IMAP server with a line of data. Response codes are optional and contain additional information beyond the status information.
This enumeration is used by the ImapResponse.Code property of the ImapResponse object. For example, if the response from the server is
* OK [UIDVALIDITY 3857529045] UIDs valid
then ImapResponse.Code will be ImapCode.UidValidity.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.ImapCode
Target Platforms: Microsoft .NET Framework 2.0