C# Examples

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

C# Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

Delete POP3 Email

Download: 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.

Email Component · XML Parser