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 in Getting Exchange items and attachments.
<!--- Get all meeting notifications from the Inbox. --->
<cfexchangemail action="get" name="requests" connection="conn1">
<cfexchangefilter name="MessageType" value="Meeting">
<!--- Get the meeting request data and put it in an array. --->
<cfexchangemail action="getmeetinginfo" connection="conn1"
name="meeting" meetinguid="#MeetingUID#" mailUID="#UID#">
<!--- Loop through the request data array and delete any outdated
meeting messages from the Inbox. --->
<cfloop index="i" from="1" to="#ArrayLen(meetingData)#" >
<cfif meetingData[i].StartTime LTE now()>
<cfexchangemail action="delete" connection="conn1"
For another example that deletes all mail from a known spam address, see Using persistent connections in Managing connections to the Exchange server.