![MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX... Use Manual Download Page 33](http://html1.mh-extra.com/html/macromedia/coldfusion-mx-7-0-2-using-coldfusion-mx-with-flex/coldfusion-mx-7-0-2-using-coldfusion-mx-with-flex_use-manual_3298315033.webp)
Test the application
33
<!--- Send the e-mail. --->
<cfmail from="#mailfrom#"
to="#mailto#"
subject="#mailsubject#">
<cfoutput>#mailmessage#</cfoutput>
</cfmail>
<!--- Create the structure to send back to Flex. --->
<cfset success = StructNew()>
<cfset success.body = "E-mail was sent at " & Now()>
<cfset success.destination = "ColdFusionGateway">
<!--- Send the structure to Flex. --->
<cfset ret = SendGatewayMessage("Flex2CF2", success)>
</cffunction>
</cfcomponent>
2.
Save the file handleemail.cfc in the C:\CFusionMX7\wwwroot\flexgatewayexamples
folder.
Test the application
To test the sample application, you must set up the testing environment, run the Flex
application, and then view your e-mail client to ensure that the application sent the e-mail
message successfully.
Set up the testing environment
Before testing the sample application, do the following:
■
Ensure that Flex Data Services 2 is running.
■
Ensure that ColdFusion is running.
■
Start the Flex2CF2 Flex Event Gateway instance.
To start the Flex2CF2 Flex Event Gateway instance:
1.
Start the ColdFusion MX Administrator.
2.
Select Event Gateways >Gateway Instances.
3.
Click the Start button next to the Flex2CF2 gateway instance.
TIP
To make debugging easier, you may want to start ColdFusion in a console by going to
the CFusionMX7\bin directory and entering
cfstart
.