Receiving E-mail Messages

the Post Office Protocol tag, cfpop, expands your ability to add Internet mail client features and e-mail consolidation to applications. While a conventional mail client provides an adequate interface for personal mail, there are many cases in which an alternative interface to some mailboxes is desirable. cfpop is a tool to develop targeted mail clients to suit the specific needs of a wide range of applications.

Use cfpop in applications when you want to receive e-mail. Here are two instances in which implementing POP mail makes sense:

For more information on cfpop syntax and variables, see the CFML Reference.

Using cfpop

Use the followig steps to add POP mail to your application

To implement the cfpop tag in your ColdFusion application:

  1. Choose which mail boxes you want to access within your ColdFusion application.
  2. Determine what mail message components you must process: message header, message body, attachments, and so on.
  3. Decide whether you must store the retrieved messages in a database.
  4. Decide whether you must delete messages from the POP server after you retrieve them.
  5. Incorporate the cfpop tag in your application and create a user interface for accessing a mailbox.
  6. Build an application page to handle the output. Retrieved messages can include ASCII characters that do not display properly in the browser.

    You use the cfoutput tag with the HTMLCodeFormat and HTMLEditFormat functions to control output to the browser. These functions convert characters with special meanings in HTML, such as <, >, and &, into HTML escaped characters, such as &lt;, &gt;, and &amp;. The HTMLCodeFormat tag also surrounds the text in a pre tag block. Note the use of these functions in the examples in this chapter.

cfpop query variables

Two variables are returned for each cfpop query that provide record number information:

You can reference these properties in a cfoutput tag by prefixing the query variable with the query name in the name attribute of cfpop:

<cfoutput>

This operation returned #Sample.RecordCount# messages.

</cfoutput>



Banner.Novgorod.Ru