Visual Basic Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SFTP
SMTP
Socket
Spider
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
Bzip2
PPMD
Deflate
LZW


VB Strings
VB Byte Array

 

 

 

 

 

 

 

Process Large POP3 Mailbox

Download Chilkat Email ActiveX

VB6 example showing a way to process a large POP3 mailbox (i.e. a POP3 mailbox that contains a very large number of messages).

    ' Demonstrate a reasonable way to handle reading a large POP3 mailbox.
    Dim mailman As New ChilkatMailMan2
    mailman.UnlockComponent "Anything for 30-day trial"
    
    ' Set our POP3 mail server hostname and login
    mailman.MailHost = "mail.chilkatsoft.com"
    mailman.PopUsername = "***"
    mailman.PopPassword = "***"
    
    ' Get the complete set of UIDLs for this user account's mailbox.
    Dim uidls As CkStringArray
    
    ' Each call is a separate, stateless POP3 session, so we want to minimize
    ' the number of calls...
    Set uidls = mailman.GetUidls()
    
    Dim bundle As ChilkatEmailBundle2
    
    iter = 0
    While (uidls.Count > 0)
        
        iter = iter + 1
        If (iter > 1000) Then
            MsgBox "Too many iterations!"
            Exit Sub
        End If
        
        ' Get a chunk of up to 100 UIDLs.
        Dim chunk As New CkStringArray
        chunk.Clear
        While ((chunk.Count < 100) And (uidls.Count > 0))
            chunk.Append uidls.GetString(0)
            uidls.RemoveAt 0
        Wend
        
        MsgBox "Iteration " + Str(iter) + ", uidls size = " + Str(uidls.Count) + ", chunk size = " + Str(chunk.Count)
    
        ' Fetch a chunk of email.
        Set bundle = mailman.FetchMultiple(chunk)
        
        ' Process this chunk...
        msgCount = bundle.MessageCount
        For i = 0 To msgCount - 1
            Dim email As ChilkatEmail2
            Set email = bundle.GetEmail(i)
            List1.AddItem email.Subject
        Next
        
        ' Delete this chunk of email...
        mailman.DeleteMultiple chunk
    Wend
        

 

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