User Guide

Table Of Contents
Contents 11
PART VII: Using External Resources
CHAPTER 39: Sending and Receiving E-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Using ColdFusion with mail servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Sending e-mail messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
Sample uses of the cfmail tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
Using the cfmailparam tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
Receiving e-mail messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983
Handling POP mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
CHAPTER 40: Interacting with Remote Servers . . . . . . . . . . . . . . . . . . . . . . . . 991
About interacting with remote servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991
Using cfhttp to interact with the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992
Creating a query object from a text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994
Using the cfhttp Post method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996
Performing file operations with cfftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 999
CHAPTER 41: Managing Files on the Server . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
About file management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
Using cffile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003
Using cfdirectory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012
Using cfcontent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014
CHAPTER 42: Using Event Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019
About event gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1020
Event gateway facilities and tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024
Structure of an event gateway application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1027
Configuring an event gateway instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1028
Developing an event gateway application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029
Deploying event gateways and applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1037
Using the CFML event gateway for asynchronous CFCs. . . . . . . . . . . . . . . . . . 1038
Using the example event gateways and gateway applications . . . . . . . . . . . . . . . 1040
CHAPTER 43: Using the Instant Messaging Event Gateways . . . . . . . . . . . . . 1047
About ColdFusion and instant messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1047
Configuring an IM event gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1050
Handling incoming messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1052
Sending outgoing messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1053
Sample IM message handling application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1054
Using the GatewayHelper object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058