Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Delete Multiple Emails by UIDL
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.