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




Contains the values of status codes defined by IMAP.

Syntax

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 

Members

MemberDescription
Bad3 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.
Bye5 Shutdown. Indicates the server is about to close the connection to the client. This can occur during logout, inactivity, or as a server warning.
No2 Failure. Indicates a unsuccessful command completion. Otherwise, this response is considered a warning.
None0 No status information was returned.
Ok1 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.
PreAuth4 Preauthorization. Through some external mechanism, authentication has occurred without a login, and no login command is necessary.

Example

The following example demonstrates sending a NOOP command and checking the response.
Visual BasicCopy 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();

Remarks

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.

Inheritance Hierarchy

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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