Adobe COLDFUSION 9 Manual page 1224

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<cfset rightNow = Now()>
<cfset lastWeek = DateAdd("d","-7", rightNow)>
<cfexchangeconnection
action="open"
username ="#user1#"
password="#password1#"
server="#exchangeServerIP#"
connection="conn1">
<cfexchangemail action="get" folder="Inbox/MailTest" name="weeksMail"
connection="conn1">
<cfexchangefilter name="FromID" value="docuser2">
<cfexchangefilter name="TimeSent" from="#lastWeek#" to="#rightNow#">
</cfexchangemail>
<cfloop query="weeksMail">
<cfif weeksmail.HasAttachment>
<!--- The UID is surrounded in <> characters and has an @ character.
Extract the hexadecimal number part for use as a directory name. --->
<cfset atpos=Find('@', weeksMail.UID)>
<cfset shortUID=Mid(weeksMail.UID, 2, atpos-2)>
<cfexchangemail action="getAttachments"
connection="conn1"
folder="Inbox/MailTest"
uid="#weeksMail.uid#"
name="attachData"
attachmentPath="C:/temp/cf_files/attachments/#shortUID#"
generateUniqueFilenames="true">
<cfoutput>
Directory #shortUID# contains these attachments to the
following message:<br />
Subject: #weeksMail.Subject#<br />
Sent: #dateFormat(weeksmail.TimeSent)#<br />
<cftable query="attachData" colheaders="true">
<cfcol header="Filename" text="#attachmentFilename#">
<cfcol header="Size" text="#size#">
<cfcol header="MIME type" text="#mimeType#">
</cftable>
</cfoutput>
</cfif>
</cfloop>
<cfexchangeconnection
action="close"
connection="conn1">
Displaying images inline
If an HTML message includes inline images, the Exchange server saves the images as attachments. Take the following
steps to display the images in the retrieved message:
Use
tag
1
cfexchangemail
action to get the mail message.
get
Last updated 8/5/2010
1219

Advertisement

Table of Contents
loading

Table of Contents