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

 

 

 

 

 

 

 

Delete Multiple Emails by UIDL

Download Chilkat Email ActiveX

Reads a POP3 mailbox and selects emails for deletion based on the subject. Then calls mailman.DeleteMultiple to delete the selected emails in a single session.

    Dim mailman As New ChilkatMailMan2
    mailman.UnlockComponent "Anything for 30-day trial"

    ' Set our mail host and login
    mailman.MailHost = "mail.chilkatsoft.com"
    mailman.PopUsername = "***"
    mailman.PopPassword = "***"
    
    Dim bundle As ChilkatEmailBundle2
    Dim email As ChilkatEmail2
    
    ' Copy email from the POP3 server, leaving it on the server.
    Set bundle = mailman.CopyMail()
    If (bundle Is Nothing) Then
        MsgBox mailman.LastErrorText
        Exit Sub
    End If
    
    ' Create a CkStringArray object that will hold the UIDLs to be deleted.
    Dim saUidls As New CkStringArray
    
    n = bundle.MessageCount
    For i = 0 To n - 1
        Set email = bundle.GetEmail(i)
        If (InStr(email.Subject, "SPAM") >= 0) Then
            saUidls.Append email.Uidl
        End If
    Next

    ' Delete the emails chosen for deletion.
    If saUidls.Count > 0 Then
        success = mailman.DeleteMultiple(saUidls)
        If (success = 0) Then
            MsgBox mailman.LastErrorText
        End If
    End If

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