User Guide

314 Chapter 16 Sending and Receiving E-mail
<br>
Body:<br>
#Sample.body# <br>
<br>
Header:<br>
HTMLCodeFormat(Sample.header)# <br>
<hr>
</cfoutput>
</body>
</html>
3 Change the following line so that it refers to a valid POP mail server, as well as to a
valid user name and password:
<cfpop server="mail.company.com"
username=#username#
password=#password#
4 Save the file as hdrbody.cfm in myapps under the Web root directory and view it
in the ColdFusion Studio Browse tab or your Web browser.
Note
To avoid duplicate filenames when saving attachments, set the
generateUniqueFilenames attribute of cfpop to Yes.
Deleting messages
By default, retrieved messages are not deleted from the POP mail server. If you want
to delete retrieved messages, you must set the
action attribute to Delete. You must
also specify use the
messagenumber attribute to specify the numbers of the messages
to delete.
Using cfpop to delete a message permanently removes it from the server. If the
messagenumber does not correspond to a message on the server, ColdFusion
generates an error.
Note
Message numbers are reassigned at the end of every POP mail server
communication that contains a delete action. For example, if you retrieve four
messages from a POP mail server, the message numbers returned are 1,2,3,4. If you
then delete messages 1 and 2 with a single
cfpop tag, messages 3 and 4 are assigned
message numbers 1 and 2, respectively.