
1224
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
<!--- Create a structure with a true IsRead field --->
<cfset changeValues.IsRead="true">
<!--- Open the connection. --->
<cfexchangeConnection
action="open"
username ="#user1#"
password="#password1#"
server="#exchangeServerIP#"
connection="conn1">
<!--- Get the mail in the Inbox that is at least two weeks old. --->
<cfexchangemail action="get" name="oldMail" connection="conn1">
<cfexchangefilter name="timeSent" from="01/01/2000"
to="#DateAdd("d","-14", Now())#">
</cfexchangemail>
<!--- Loop through the resulting oldMail query and set the IsRead indicator
to true. --->
<cfloop query="oldMail">
<cfexchangemail action="set"
connection="conn1"
message="#changeValues#"
uid="#oldMail.uid#">
</cfloop>
<!--- Close the connection. --->
<cfexchangeConnection
action="close"
connection="conn1">
Moving mail between folders
To move a one or more mail messages from one folder to another, use the
cfexchangemail
tag
move
action, as shown
in the following code snippet, which moves all messages with the subject “Rams and Ewes” from the Unread folder in
the Inbox to the Sheep folder in the inbox.
<cfexchangemail action="move" connection="con1" folder="Inbox/Unread"
destinationfolder="Inbox/Sheep">
<cfexchangefilter name="subject" value="Rams and Ewes">
</cfexchangemail>
Deleting Exchange items and attachments
To delete an exchange item, use the ColdFusion Exchange tag with the
action
attribute of
delete
and specify the item
UID. Deleting the exchange item deletes all attachments
To delete only the attachments to an exchange item, use the ColdFusion Exchange tag with the
action
attribute of
deleteAttachments
and specify the item UID,
This example deletes all meeting requests in the Inbox for meetings that have passed, but does not delete any requests
in folders in the Inbox. To delete requests in the Inbox, use a separate
cfexchangemail
tag for each folder. For
information on accessing and using multiple folders, see “
Getting and using folder names
” on page 1214.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...