Retrieving the List of Messages

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:

1.
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.
2.
Use action="GetAll" to retrieve the full text of individual messages.
3.
Use action="Delete" to delete messages.

Listing 21.6 is the first of three templates ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.