Imap Object : Mailboxes Property |
Visual Basic |
---|
Public Property Mailboxes As Mailboxes |
The Refresh method populates this property.
Private Sub Command1_Click() On Error GoTo OnError ' use intrinsic error handling Dim Mailbox As Mailbox 'Set timeout to 30 seconds Imap1.Timeout = 30000 Imap1.Login "imap.dart.com", "user", "pass" 'Logged in, get mailbox listing Imap1.Refresh 'Display mailboxes returned in listing For Each Mailbox In Imap1.Mailboxes List1.AddItem Mailbox.Name Next Exit Sub OnError: ' Any error jumps here Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub