Whatever message this page gives is out now! Go check it out!
<cfexchangeConnection action="open" username ="#user2#" password="#password2#" server="#exchangeServerIP#" connection="conn1"> <!--- Get the names and paths to all subfolders. ---> <cfexchangeconnection action="getSubfolders" connection="conn1" name="folderInfo" folder="Inbox" recurse="yes"> <!--- Get the information from the Inbox top level. The getSubfolders results do not include an Inbox row. ---> <cfexchangemail action="get" connection="conn1" name="theResponses"> <cfexchangefilter name="MessageType" value="Meeting_Response"> </cfexchangemail> <!--- Use a query of queries to select only the declined meetings. ---> <!--- You cannot use cfexchangefilter to filter for the meeting response type. ---> <cfquery dbtype="query" name="theResponses"> SELECT * FROM theResponses WHERE MEETINGRESPONSE = 'Decline' </cfquery> <!--- Loop through the subfolders and get the meeting responses from each folder. ---> <cfloop query="folderInfo"> <cfexchangemail action="get" connection="conn1" name="#folderinfo.foldername#"> <cfexchangefilter name="folder" value="#folderinfo.folderpath#"> <cfexchangefilter name="MessageType" value="Meeting_Response"> </cfexchangemail> <!--- Use the evaluate function to get the name of the folder. ---> <cfset meetingData=evaluate(folderinfo.foldername)> <!--- Use a query of queries with a UNION clause to add this folder's results to the theResponses query. ---> <cfquery dbtype="query" name="theResponses"> SELECT * FROM meetingData WHERE MEETINGRESPONSE = 'Decline' UNION SELECT * FROM theResponses </cfquery> </cfloop> <!--- Close the connection. ---> <cfexchangeConnection action="close" connection="conn1"> <!--- Display the results. ---> <h3>The Declined Responses:</h3> <cftable query="theResponses" colheaders="yes" border="yes"> <cfcol header="From" text="#FROMID#"> <cfcol header="Subject" text="#SUBJECT#"> <cfcol header="Message" text="#MESSAGE#"> </cftable> |
action="get" name="results query object name" connection information> <cfexchangefilter name="filter type" value"filter value> <cfexchangefilter name="data/time filter type" from="start date/time" to="end date/time"> . . . </cfexchange> |
<cfset lastWeek = DateAdd("d","-7", rightNow)> <cfexchangemail action="get" name="weeksMail" username ="#user1#" password="#password1#" server="#exchangeServerIP#"> <cfexchangefilter name="FromID" value="adobe.com"> <cfexchangefilter name="TimeSent" from="#lastWeek#" to="#rightNow#"> </cfexchangemail> <cfdump var="#weeksMail#"> |
connection="myconn1" uid="#theUID#" name="#attachInfo#" attachmentPath="C:/temp/cf_files/attachments" generateUniqueFilenames="true"> |
<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"> |
<cfexchangeconnection action="open" username = "#user1#" password = "#password1#" server = "#exchangeServerIP#" connection = "testconn"> <!--- Get the mail message. ---> <cfexchangeMail action="get" connection ="testconn" name="getMail"> <cfexchangeFilter name="Subject" value="sample inline image"> </cfexchangeMail> <cfdump var="#getMail#"> <!--- The following code assumes we found only one matching message. ---> <cfoutput query="getMail"> <cfset theUID = #getMail.UID#> <cfset htmlmessage = getMail.htmlmessage> </cfoutput> <!--- Get the message attachments. ---> <CFExchangeMail action="getAttachments" UID ="#theUID#" connection="testconn" name="attachments" attachmentPath="C:\ColdFusion8\wwwroot\My_Stuff\cfexchange\Book\attachments" generateuniquefilenames="no"> <!--- Extract the image names from the mail message ---> <!--- Initialize the index into the message used in finding ---> <cfset findstart = 1> <!--- Use an index loop to find all image source entries in the message ---> <!--- This example supports up to 25 inline images ---> <cfloop index="i" from="1" to="25"> <!--- find a cid: entry ---> <cfset stringStart[i] = Find('"cid:', htmlmessage, findstart)> <!--- Exit the loop if no match was found ---> <cfif (stringstart[i] EQ 0)> <cfbreak> </cfif> <!--- Increment the string index used in finding images. ---> <cfset findstart = stringstart[i] +5 > <!--- Get text to the right of BADCHARcid:.BADCHAR Using a string length of 30 should get more than the image name. ---> <cfset rightpart[i]=Mid(htmlmessage, findstart, 30)> <!--- use the ListFirst function to remove all the text starting at the quotation mark. ---> <cfset imagename[i]=ListFirst(rightpart[i], '"')> <!--- Loop over the attachments query and find the CID. ---> <cfloop query="attachments"> <!--- Replace the image name with the contents of the attachment ---> <cfif attachments.CID EQ imagename[i]> <cfset htmlmessage = Replace(htmlmessage,"cid:#imagename[i]#", "attachments/#attachments.ATTACHMENTFILENAME#")> </cfif> </cfloop> </cfloop> <h3>The full mail message</h3> <cfoutput>#htmlmessage#</cfoutput> <cfexchangeconnection action="close" connection = "testconn"> |