PowerTCP Mail for .NET
Examine Method
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Imap Class : Examine Method




mailboxName
The name of the mailbox to open.
Select a mailbox by using the EXAMINE command.

Syntax

Visual Basic (Declaration) 
Public Function Examine( _
   ByVal mailboxName As String _
) As ImapResponse
Visual Basic (Usage)Copy Code
Dim instance As Imap
Dim mailboxName As String
Dim value As ImapResponse
 
value = instance.Examine(mailboxName)
C# 
public ImapResponse Examine( 
   string mailboxName
)
Managed Extensions for C++ 
public: ImapResponse* Examine( 
   string* mailboxName
) 
C++/CLI 
public:
ImapResponse^ Examine( 
   String^ mailboxName
) 

Parameters

mailboxName
The name of the mailbox to open.

Return Value

An ImapResponse object representing the response from the server.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.ProtocolExceptionBad IMAP protocol response received from server.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.

Example

The following example demonstrates using the LineReceived event to detect values of RECENT and EXISTS responses.
Visual BasicCopy Code
Private Sub ExamineTest()
   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Examine a mailbox.
   Dim Response As ImapResponse = Imap1.Examine("TestBox")

   ' Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + Response.ToString())
End Sub

Private Sub Imap1_LineReceived(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapResponseEventArgs) Handles Imap1.LineReceived
   Dim Response As ImapResponse
   For Each Response in e.Responses
      If Response.Operation = "EXISTS" Then
         Debug.WriteLine("Value of EXISTS: " + Response.Value)
      End If
      If Response.Operation = "RECENT" Then
         Debug.WriteLine("Value of RECENT: " + Response.Value)
      End If
   Next
End Sub
C#Copy Code
private void ExamineTest()
{
   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Examine a mailbox.
   ImapResponse response = imap1.Examine("TestBox");

   // Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + response.ToString());
}

private void imap1_LineReceived(object sender, Dart.PowerTCP.Mail.ImapResponseEventArgs e)
{
   foreach(ImapResponse response in e.Responses)
   {
      if(response.Operation == "EXISTS")
         Debug.WriteLine("Value of EXISTS: " + response.Value);
      if(response.Operation == "RECENT")
         Debug.WriteLine("Value of RECENT: " + response.Value);
   }
}

Remarks

The Imap.Examine method selects a mailbox by issuing the EXAMINE command to the server, setting the current mailbox to the mailbox specified by mailboxName. If successful, the Imap.CurrentMailbox is set to an instance of a Mailbox object. This method opens the mailbox for reading only (Mailbox.Readonly = true).

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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