SocketTools .NET Edition

ImapClient.SelectMailbox Method 

Selects the specified mailbox for read-write access.

[Visual Basic]
Public Function SelectMailbox( _
   ByVal mailboxName As String _
) As Boolean
[C#]
public bool SelectMailbox(
   string mailboxName
);

Parameters

mailboxName
A string argument which specifies the name of the mailbox to be selected.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The SelectMailbox method is used to select a mailbox in read-write mode. If the client has a different mailbox currently selected, that mailbox will be closed and any messages marked for deletion will be expunged. To prevent deleted messages from being removed from the previous mailbox, use the UnselectMailbox method prior to selecting the new mailbox.

The special case-insensitive mailbox name INBOX is used for new messages. Other mailbox names may or may not be case-sensitive depending on the IMAP server's operating system and implementation.

To access a mailbox in read-only mode, use the ExamineMailbox method.

See Also

ImapClient Class | SocketTools Namespace