PowerTCP Mail for .NET
ImapCode Enumeration
Example  See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace : ImapCode Enumeration




Represents the response codes defined by IMAP.

Syntax

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 

Members

MemberDescription
Alert1 The response contains an alert which must be shown to the user. This also causes the Imap.Alert event to be raised.
BadCharset2 The response denotes a SEARCH operation failed due to an unsupported charset.
Capability3 The response contains a list of IMAP server capabilities. This type of response is also used to populate the Imap.Capabilities collection.
NewName4 The response denotes an operation failed because the Mailbox was renamed.
None0 No response code was provided.
Parse5 The response denotes an error occurred during the parsing of message headers.
PermanentFlags6 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.
ReadOnly7 The response denotes the selected mailbox is read-only.
ReadWrite8 The response denotes the selected mailbox is read-write.
TryCreate9 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.
UidNext10 The response includes the UIDNEXT value for the selected mailbox, indicating what the UID of the next created message will be.
UidValidity11 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.
Unseen12 The response code of the response includes the number (position id) of the first unseen message in the selected mailbox.

Example

The following example demonstrates using the LineReceived event to detect UIDVALIDITY codes.
Visual BasicCopy 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);
   }
}

Remarks

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.

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Dart.PowerTCP.Mail.ImapCode

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.