Most uses of the <cfpop> tag call for all three of the action values it supports. Whether you are using the tag to display messages to your users (such as a Web-based system for checking mail) or an automated agent that responds to incoming email messages on its own, the sequence of events probably involves these steps:
Log in to the mail server with action="GetHeaderOnly" to get the list of messages currently in the specified mailbox. At this point, you can display or make decisions based on who the message is from, the date, or the subject line.
Use action="GetAll" to retrieve the full text of individual messages.
Use action="Delete" to delete messages.
Listing 21.6 is the first of three templates ...