Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor


VB Strings
VB Byte Array

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

IMAP Sub-Folders and Mailboxes

How to select an IMAP sub-folder.

Download Chilkat IMAP ActiveX

Dim imap As New ChilkatImap

Dim success As Long

'  Anything unlocks the component and begins a fully-functional 30-day trial.
success = imap.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    MsgBox imap.LastErrorText
    Exit Sub
End If

'  Connect to an IMAP server.
success = imap.Connect("mail.chilkatsoft.com")
If (success <> 1) Then
    MsgBox imap.LastErrorText
    Exit Sub
End If

'  Login
success = imap.Login("admin@chilkatsoft.com","****")
If (success <> 1) Then
    MsgBox imap.LastErrorText
    Exit Sub
End If

'  The default value of the mailbox hierarchy separator char
'  is a period '.' char.
MsgBox "Separator Char: " & imap.SeparatorChar

'  If you know your IMAP server's separator char, you may
'  explicitly set it.  For example:
imap.SeparatorChar = "/"
MsgBox "Separator Char: " & imap.SeparatorChar

'  If you don't know the value of the separator char, the
'  Chilkat IMAP component sets it automatically during
'  a ListMailboxes call.  (The reason is that the IMAP separator
'  char is specified in the IMAP list mailboxes response.)
Dim mboxes As Mailboxes
Set mboxes = imap.ListMailboxes("","*")

MsgBox "Separator Char: " & imap.SeparatorChar

'  To select a sub-folder, start with the top-level mailbox
'  and build a path using the separator char.  The top-level
'  mailbox should be named "Inbox":
Dim folderPath As String
Dim s As String
s = imap.SeparatorChar
folderPath = "Inbox" & s & "oldEmail"

success = imap.SelectMailbox(folderPath)
If (success <> 1) Then
    MsgBox imap.LastErrorText
    Exit Sub
End If

Text1.Text = Text1.Text & "Number of messages in " & folderPath & ": " & imap.NumMessages & vbCrLf
Text1.Refresh

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.