| Visual Basic (Declaration) | |
|---|---|
Public Enum ImapResponseType Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapResponseType | |
| C# | |
|---|---|
public enum ImapResponseType : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
__value public enum ImapResponseType : public System.Enum | |
| C++/CLI | |
|---|---|
public enum class ImapResponseType : public System.Enum | |
| Member | Description |
|---|---|
| Continuation | 0 The server expects the client to send additional data. This is not an error, but just a step in a data transfer process for certain commands. |
| Data | 1 The response includes data that is sent in response to a command that is being executed (ex. a response to a LIST command). |
| Raw | 2 The server is returning raw information (ex. the contents of a message). |
| Status | 3 The server is indicating the status of a currently executing command. The ImapResponse.Status property indicates the value of that status. |
The following example demonstrates using the LineReceived event to detect Status responses.
| 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 is a status response. If Response.ResponseType = ImapResponseType.Status Then Debug.WriteLine("The server has returned a status response") Debug.WriteLine("Status: " + Response.Status) Debug.WriteLine("Explanation: " + Response.Explanation) 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 is a status response. if(response.ResponseType == ImapResponseType.Status) { Debug.WriteLine("The server has returned a status response"); Debug.WriteLine("Status: " + response.Status); Debug.WriteLine("Explanation: " + response.Explanation); } } } | |
The ImapResponseType enumeration indicates the type of response received from the server. This value is exposed through the ImapResponse.ResponseType property.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.ImapResponseType
Target Platforms: Microsoft .NET Framework 2.0