![]() ![]() ![]() |
CFPOP, the Post Office Protocol tag, expands the ColdFusion developer's ability to add Internet mail client features and email consolidation to applications. While a conventional mail client provides an adequate interface for personal mail, there are many cases where 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 email. Here are two instances where implementing POP mail makes sense:
Use the CFPOP tool in the CFML Advanced toolbar in ColdFusion Studio to add CFPOP tags to your pages.
See the CFML Language Reference for more information on CFPOP syntax and variables.
This example shows the basic syntax of CFPOP:
<CFPOP SERVER="my.mailserver.com" USERNAME=#username# PASSWORD=#pwd# ACTION="GetHeaderOnly" NAME="getmsghdrs"> <BODY> <CFOUTPUT> You have #getmsghdrs.RecordCount# messages to read. </CFOUTPUT> <CFOUTPUT QUERY="getmsghdrs"> <P><B>Date: </B>#getmsghdrs.date#</P> <P><B>From: </B>#getmsghdrs.from#</P> </CFOUTPUT> </BODY>
Use the CFOUTPUT tag with the HTMLCodeFormat and HTMLEditFormat functions to control output to the browser. Note the use of these functions in the examples.
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>
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.