Connection code:
#include "NetServices.as"
//#include "NetDebug.as"
// remoting code
if (isGatewayOpen == null) {
// do this code only once
isGatewayOpen = true;
NetServices.setDefaultGatewayUrl("http://127.0.0.1:8100/cfusion/ flashservices/gateway");
gatewayConnnection = NetServices.createGatewayConnection();
mailService = gatewayConnnection.getService("com.mySite.mail", this);
trace("sent request for conn");
}
// gather the data from the form and send to the CFC using the mailTo method
function submitOrder(){
myForm=new Object();
myForm.name=name_txt.text;
myForm.email=email_txt.text;
myForm.addr1=addr1_txt.text;
myForm.city=city_txt.text;
myForm.state=state_cb.getValue();
myForm.postcode=postcode_txt.text;
myForm.order=currentOrder_txt.text;
mailService.mailto(myForm);
trace("sent mail request");
}
function mailto_Result(result){
trace("server responded: email sent");
gotoAndStop("submitted");
}
and my CFC code was this:
<cfcomponent>
<cffunction name="mailto" access="remote">
<cfargument name="name" type="string" required="true">
<cfargument name="email" type="string" required="true">
<cfargument name="addr1" type="string" required="true">
<cfargument name="city" type="string" required="true">
<cfargument name="state" type="string" required="true">
<cfargument name="postcode" type="string" required="true">
<cfargument name="order" type="string" required="true">
<CFMAIL to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]" Subject="Order Request">
The following order has been submitted! Name: #name# Email: #email# Address: #addr1# City: #city# State: #state# Postcode: #postcode# Order: #order#
</CFMAIL>
<cfset myMail="sent">
<cfreturn myMail>
</cffunction>
</cfcomponent >
On Thursday, December 11, 2003, at 11:31 AM, Ricardo Russon wrote:
Not sure if i should be posting here or on cfaussie, (or both)
I want to make a form in flash and have it email to various departments. I
will be processing with coldfusion and cfmail.
my question is which is the best way to connect it to the coldfusion, using
XML, getURL appending the variables, using flash remoting? Any advice? pro's
con's.
Thanks Ricardo.
---
You are currently subscribed to fugli as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
Jon Bloomer - Web Designer One Of A Kind email: [EMAIL PROTECTED] http://www.oneofakind.com.au P: 02-9699-2477 F: 02-9699-2857 PO Box 1466 Darlinghurst NSW 2010
--- You are currently subscribed to fugli as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
