MailboxName Property  
 

Gets and sets the name of the current mailbox.

Syntax

object.MailboxName [= mailbox ]

Remarks

The MailboxName property returns the name of the currently selected mailbox. If no mailbox has been selected by the client, this property will return an empty string.

Setting the MailboxName property will select a new 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, call the UnselectMailbox method prior to selecting the new mailbox. Setting the MailboxName property to an empty string will cause the current mailbox to be unselected, and a new mailbox will not be selected. Before the application can access any messages, it must select a new mailbox.

Selecting a new mailbox will automatically update those properties which provide information about the current mailbox, such as the MailboxFlags and MailboxUID properties. If an application wishes to update the information for the current mailbox, simply set the MailboxName property again with the same mailbox name. Note that this will not cause any messages marked for deletion to be expunged.

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.

If the mailbox name contains international characters then it is automatically encoded using a modified version of UTF-7 encoding. For example, if a mailbox is named "Håndskrift", the mailbox name created on the server will be the string "H&AOU-ndskrift". The control will automatically decode UTF-7 encoded mailbox names, making the conversion transparent to the application.

Data Type

String

See Also

Mailbox Property, Mailboxes Property, MailboxFlags Property, MailboxUID Property, ReadOnly Property, SelectMailbox Method, UnselectMailbox Method