PowerTCP Mail for .NET
Mailbox Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > MailboxEventArgs Class : Mailbox Property




Gets the Mailbox object representing the IMAP mailbox for which the event was raised.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Mailbox As Mailbox
Visual Basic (Usage)Copy Code
Dim instance As MailboxEventArgs
Dim value As Mailbox
 
value = instance.Mailbox
C# 
public Mailbox Mailbox {get;}
Managed Extensions for C++ 
public: __property Mailbox* get_Mailbox();
C++/CLI 
public:
property Mailbox^ Mailbox {
   Mailbox^ get();
}

Property Value

The Mailbox object representing the mailbox.

Example

The following example demonstrates asynchronously creating a new mailbox.
Visual BasicCopy Code
private void AsynchronousMailboxCreateTest()
{
   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Begin to asynchronously create a new mailbox. When
   ' complete, the Imap.EndMailboxAdd event will be raised.
   Imap1.Mailboxes.BeginAdd("MyNewMailbox", Nothing)
}

Private Sub Imap1_EndMailboxAdd(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.MailboxEventArgs) Handles Imap1.EndMailboxAdd
   If e.Exception Is Nothing Then
      Debug.WriteLine("New mailbox " + e.Mailbox.Name + " created.")
   Else
      Debug.WriteLine("Exception received: " + e.Exception.Message)
   End If
End Sub
C#Copy Code
private void AsynchronousMailboxCreateTest()
{
   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Begin to asynchronously create a new mailbox. When
   // complete, the Imap.EndMailboxAdd event will be raised.
   imap1.Mailboxes.BeginAdd("MyNewMailbox", null);
}

private void imap1_EndMailboxAdd(object sender, Dart.PowerTCP.Mail.MailboxEventArgs e)
{
   if(e.Exception == null)
      Debug.WriteLine("New mailbox " + e.Mailbox.Name + " created.");
   else
      Debug.WriteLine("Exception received: " + e.Exception.Message);
}

Remarks

If accessing this property from within the Imap.EndMailboxAdd event (notifying completion of the MailboxCollection.BeginAdd method), then this property returns the Mailbox object representing the newly created mailbox. If accessing this property from within the Imap.Mailbox event (notifying new mailbox data was received from the server) then this property returns the Mailbox object representing the mailbox for which new data was received.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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