Receiving e-mail messages
797
Error logging and undelivered messages
ColdFusion logs all errors that occur during SMTP message processing to the file
mail.log
in
the ColdFusion log directory. The log entries contain the date and time of the error as well as
diagnostic information about why the error occurred.
If a message is not delivered because of an error, ColdFusion writes it to this directory:
•
In Windows: \CFusionMX\Mail\UnDelivr
•
On UNIX: /opt/coldfusionmx/mail/undelivr
The error log entry that corresponds to the undelivered message contains the name of the file
written to the UnDelivr (or undelivr) directory.
For more information about the mail logging settings in the ColdFusion MX Administrator, see
Configuring and Administering ColdFusion MX
.
Receiving e-mail messages
You create ColdFusion pages to access a Post Office Protocol (POP) server to retrieve e-mail
message information. ColdFusion can then display the messages (or just header information),
write information to a database, or perform other actions.
The
cfpop
tag lets you add Internet mail client features and e-mail consolidation to applications.
Although a conventional mail client provides an adequate interface for personal mail, there are
many cases in which an alternative interface to some mailboxes is advantageous. You use
cfpop
to
develop targeted mail clients to suit the specific needs of a wide range of applications. The
cfpop
tag does not work with the other major e-mail protocol, Internet Mail Access Protocol (IMAP).
Here are three instances in which implementing POP mail makes sense:
•
If your site has generic mailboxes that are read by more than one person
(
), it can be more efficient to construct a ColdFusion mail front end to
supplement individual user mail clients.
•
In many applications, you can automate mail processing when the mail is formatted to serve a
particular purpose; for example, when subscribing to a list server.
•
If you want to save e-mail messages to a database.
Using
cfpop
on your POP server is like running a query on your mailbox contents. You set its
action
attribute to retrieve either headers (using the
GetHeaderOnly
value) or entire messages
(using the
GetAll
value) and assign it a
name
value. You use the name to refer to the record set
that
cfpop
returns, for example, when using
cfoutput
. To access a POP server, you also must
define the
server
,
username
, and
password
attributes.
For more information on
cfpop
syntax and variables, see
CFML Reference
.
Using cfpop
Use the following steps to add POP mail to your application.
To implement the cfpop tag in your application:
1
Choose the mailboxes to access within your ColdFusion application.
2
Determine which 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.
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......