Opens or closes a persistent connection to an Microsoft Exchange server, or gets information about mailbox subfolders. You must have a persistent or temporary connection to use the cfexchangecalendar, cfexchangecontact, cfexchangemail, and cfexchangetask tags.
ColdFusion 8: Added this tag.
open <cfexchangeconnection required action = "open" connection = "connection ID
"> server = "Exchange server ID
" username = "Exchange user ID
"> optional ExchangeServerLanguage = "Language name
" formBasedAuthentication = "no|yes"> mailboxName = "Exchange mailbox
"> password = "user password
" port = "IP port
" protocol = "http|https" proxyHost = "proxy host URL
" proxyPort = "proxy IP port
" getSubfolders <cfexchangeconnection required action = "getSubfolders" connection = "connection ID
"> name = "query name
" optional folder = "Exchange folder path
"> recurse = "no|yes"> OR <cfexchangeconnection required action = "getSubfolders" name = "query name
" server = "Exchange server ID
" username = "Exchange user ID
"> optional ExchangeServerLanguage = "Language name" folder = "Exchange folder path
"> formBasedAuthentication = "no|yes"> mailboxName = "Exchange mailbox
"> password = "user password
" port = "IP port
" protocol = "http|https" proxyHost = "proxy host URL
" proxyPort = "proxy IP port
" recurse = "no|yes"> close <cfexchangeconnection required action = "close" connection = "connection ID
">
cfexchangecalendar, cfexchangecontact, cfexchangefilter, cfexchangemail, cfexchangetask "Managing connections to the Exchange server" in the ColdFusion Developer's Guide
Attribute |
Action |
Req/Opt |
Default |
Description |
---|---|---|---|---|
action |
all |
Required |
|
The action to take. Must be one of the following values:
|
connection |
all |
Required for open and close actions |
|
The name of the connection. You can specify this ID in any tag that you use with the open connection. |
ExchangeServerLanguage |
open getSubfolders |
Optional |
english |
The language of the Exchange server. If you are not sure, you can specify the empty string. For all values except english, including the empty string, the tag tries to get folder names from the server in the client's local language. In some cases, such as when there is a large amount of data on the server, it might take significant time to get folder names from Exchange server in the local language. |
folder |
getSubfolders |
Optional |
The root of the mailbox |
The forward slash (/) delimited path from the root of the mailbox to the folder for which to get subfolders. If a folder name contains a forward slash, use the _xF8FF_ escape sequence to specify the character in the name. |
formBasedAuthentication |
open getSubfolders |
Optional |
no |
A Boolean value that specifies whether to display a login form and use form based authentication when making the connection. If the attribute value is no (the default), and the Exchange server returns a 440 error status when ColdFusion tries to connect, ColdFusion displays the login form and attempts to use form based authentication. Therefore, you can safely omit this attribute if you do not know if the server requires form based authentication. |
mailboxName |
open getSubfolders |
Optional |
|
The ID of the Exchange mailbox to use. Specify this attribute to access a mailbox whose owner has delegated access rights to the account specified in the username attribute. |
name |
getSubfolders |
Required |
|
The name of the ColdFusion query variable that contains information about the subfolders. |
password |
open getSubfolders |
Optional |
|
The user's password for accessing the Exchange server. |
port |
open getSubfolders |
Optional |
80 |
The port on the server connect to, most commonly port 80. |
protocol |
open getSubfolders |
Optional |
http |
The protocol to use for the connection. Valid values are http and https. |
proxyHost |
open getSubfolders |
Optional |
|
The URL or IP address of a proxy host, if required for access to the network. |
proxyPort |
open getSubfolders |
Optional |
|
The port on the proxy server to connect to, most commonly port 80. |
recurse |
getSubfolders |
Optional |
false |
A Boolean value:
|
server |
open getSubfolders |
Required |
|
The IP address or URL of the server that is providing access to Exchange. |
username |
open getSubfolders |
Required |
|
The Exchange user ID. |
The cfexchangeconnection tag can open or close a persistent connection with an Exchange server. If you use the cfexchangeconnection to open a connection before you use any cfexchangecalendar, cfexchangecontact, cfexchangemail, or cfexchangetask tags, you can use multiple tags to interact with the Exchange server without incurring the overhead of creating a connection for each tag.
Use the cfexchangeconnection tag to close a persistent connection when you are finished accessing the Exchange server. If you do not close the connection, it remains open and does not time out.
The cfexchangecalendar, cfexchangecontact, cfexchangemail, and cfexchangetask tags also let you specify the open action connection attributes (but not the connection attribute) to create a temporary connection that lasts for the duration of the single tag's activities, without requiring you to use the cfexchangeconnection tag to create the connection. In this case, ColdFusion automatically closes the connection when the tag completes processing.
The getSubfolders action can get information about the immediate subfolders of a specified folder (or of the top level of the mailbox), or information about all levels of subfolders. You must have a persistent connection to get the subfolders.
The query returned by the getSubfolders action has the following columns:
Column |
Contents |
---|---|
FOLDERNAME |
The name of the subfolder, for example, ColdFusion. |
FOLDERPATH |
The forward slash (/) delimited path to the folder from the mailbox root, including the folder name, for example, Inbox/Marketing/ColdFusion. |
FOLDERSIZE |
Size of the folder in bytes. |
The following example opens a connection, gets all mail sent from spamsource.com, and deletes the messages from the Exchange server:
<cfexchangeConnection action="open" username="#user1#" password="#password1#" server="#exchangeServerIP#" connection="testconn1"> <cfexchangemail action="get" name="spamMail" connection="testconn1"> <cfexchangefilter name="fromID" value="spamsource.com"> </cfexchangemail> <cfloop query="spamMail"> <cfexchangeMail action="delete" connection="testconn1" uid="#spamMail.uid#"> </cfloop> <cfexchangeConnection action="close" connection="testconn1">