SelectMailbox Method
Selects specified mailbox on the IMAP4 server.
Every IMAP4 account has at least "Inbox" mailbox. To get list of available
mailboxes, use RetrieveMailboxes
method.
| blnResult = ObjectName.SelectMailbox(MailboxName) | ||
| Parameters: | ||
| MailboxName As String | Name of the mailbox to select | |
| Return value As Boolean | True if successful, False if error has occurred. You can check ErrDesc property or log file to get more detailed error information | |
Usage example:
' This sample selects "Inbox" mailbox and displays total number of messages there Dim Mailer 'Using visual basic to create object Set Mailer = CreateObject("MailBee.IMAP4") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.IMAP4") 'In ASP use Response.Write instead of MsgBox Mailer.EnableLogging = True ' Logging helps to discover any problems Mailer.LogFilePath = "C:\imap4_log.txt" Mailer.LicenseKey = "put your license key here" If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then If Mailer.SelectMailbox("Inbox") Then MsgBox Mailer.MessageCount & " messages in Inbox" End If Mailer.Disconnect Else MsgBox Mailer.ErrDesc End If
See Also:
Selected
Property
ExamineMailbox Method
RetrieveMailboxes Method
Copyright 2002-2008, AfterLogic Corporation. All rights reserved.