Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

July 30, 2007

New POP3 Session Management Features

The latest version of the Chilkat Email component provides POP3 session management features as well as significantly improved POP3 progress monitoring and abort capability.

Any Chilkat Mail POP3-related method will automatically connect and establish a new POP3 session if one is not already active. If a POP3 session is already established, a method will use the existing session. There is no automatic disconnect when a method returns.

There are two new methods to manually establish and close POP3 sessions:

(in pseudo-code)
boolean MailMan.Pop3BeginSession(void)

Connects to the POP3 server and authenticates. The hostname (or IP address) of the POP3 server is specified by the MailHost and MailPort properties. The PopSsl property indicates whether SSL should be used. The login name and password are specified by the PopUsername and PopPassword properties. If SPA (Secure Password Authentication) is required, the Pop3SPA property should be set.

If a POP3 session was already active, the Pop3BeginSession closes it and starts a new session.

boolean MailMan.Pop3EndSession(void)

Sends a QUIT command and closes the TCP/IP connection with the POP3 server. The QUIT command causes any message marked for delete to be deleted. Messages are marked for deletion and the connection with the POP3 server is broken before a QUIT can be issued, the messages will *not* be deleted.

There are two new MailMan properties relevant to POP3 sessions:

string MailMan.Pop3SessionLog

Commands sent to the POP3 server and the raw responses received are accumulated in this string property.

boolean MailMan.ImmediateDelete

The default value of this property is true. The POP3 protocol is such that the DELE command marks a message for deletion. It is not actually deleted until the QUIT command is sent and the session is closed. If ImmediateDelete is true (non-zero), then any Chilkat MailMan method that marks a message (or messages) for deletion will also followup with a QUIT command and close the session. If your program sets ImmediateDelete to false, it must make sure to call Pop3EndSession to ensure that messages marked for deletion are actually deleted.

Some Addtional MailMan Methods (pseudo-code)

unsigned long MailMan.GetMailboxSize(void)

Returns the size in bytes of the complete maildrop (i.e. the sum of the sizes of all emails in the mailbox).

int MailMan.GetMailboxCount(void)

Returns the number of messages in the mailbox.

boolean MailMan.Pop3Noop(void)

Sends a NOOP command to the POP3 server and receives the response.

boolean MailMan.Pop3Reset(void)

If any messages have been marked for deletion, they are unmarked.

Progress Monitoring and New Events

POP3 progress monitoring and abort capability has vastly improved with this new version. Event callbacks track:

  1. Percent completion — The PercentDone event is fired whenever the percentage completion increments by at least one percent.
  2. Heartbeat (abort check) — The AbortCheck event is fired at intervals according to the HeartbeatMs property setting. If HeartbeatMs is set to 0, then no AbortCheck events are fired. The AbortCheck event provides the application with the ability to abort any Pop3 method prior to completion. The Pop3BeginSession and Pop3EndSession methods will fire AbortCheck events, but do not fire PercentDone events (because it is impossible to measure a percent completion while waiting for a TCP/IP connection to be accepted).
  3. EmailReceived — The EmailReceived event fires when downloading headers or full emails. After each email is received, the EmailReceived event fires and passes the following information to the application: Subject, From Address, From Name, Return Path, Date, UIDL, and Size (in bytes).

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.