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 POP3 EmailDownload: Chilkat .NET Assemblies Delete selected messages from a POP3 server. Chilkat.MailMan mm = new Chilkat.MailMan(); mm.UnlockComponent("Anything for 30-day trial"); mm.MailHost = "mail.chilkatsoft.com"; mm.PopUsername = "***"; mm.PopPassword = "***"; // Download the email headers int numBodyLines = 1; Chilkat.EmailBundle bundle = mm.GetAllHeaders(numBodyLines); Chilkat.StringArray sa = new Chilkat.StringArray(); int i; int n = bundle.MessageCount; for (i=0; i<n; i++) { Chilkat.Email email = bundle.GetEmail(i); listBox1.Items.Add("-"); listBox1.Items.Add(email.From); listBox1.Items.Add(email.FromName); listBox1.Items.Add(email.FromAddress); listBox1.Items.Add(email.Subject); // Add the emails marked as SPAM to the list that will be deleted. if (email.Subject.IndexOf("#SPAM#") >= 0) { sa.Append(email.Uidl); listBox1.Items.Add("--- This will be deleted!"); } } // If there are emails to delete... if (sa.Count > 0) { bool success = mm.DeleteMultiple(sa); if (!success) { MessageBox.Show(mm.LastErrorText); } } |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.