PDA

View Full Version : Flash Remoting CFMAIL


JeffHobbs
07-16-2003, 12:28 AM
I am trying to create a email form using flash remoting. I have created a component:

<cfcomponent name = "confidentialMail">
<cffunction access="remote" name="sendMail" returntype="string" displayname="Confidential Email" hint="Confidential email">
<!---"message" will be a function in the flash movie --->
<cfargument name="message" type="string" required="true" displayname="Message" hint="Message">
<!--Send mail, based on flash input-->
<CFMAIL
TO="EmailAddress"
FROM="Confidential Intranet Email<emailAddress>;"
SUBJECT="INTRANET: Confidential Feedback" type="html"
>
#message#
</CFMAIL>
<cfreturn "Your email has been sent! Thanks for the input">
</cffunction>
</cfcomponent>

Furthermore, I have been using Lott's book for guidance on the Flash side of things. Here is what I have thus far in ActionScript:

#include "NetServices.as"
// uncomment this line when you want to use the NetConnect debugger
//#include "NetDebug.as"
// From Lott's book - Page 190
function init() {
var gwURL = "http://pw-gisweb/flashservices/gateway/";
NetServices.setDefaultGatewayURL(gwURL);
conn = NetServices.createGatewayConnection();
// create the service object - use to reference .cfc
_root.srv = conn.getService("dpw.mail.confidentialMail", this);
}
// when the button is released, call the
// confidentialMail.cfc component and pass it the email message
sendMailBtn.onRelease = function() {
// call the cfc
_root.srv.sendMail(_root.message);
trace("Button pushed");
};
// initialize the movie
init();

The current error I am getting is NetServices info 2: sendMail_Status was received from server: Service threw an exception during method invocation: The parameter MESSAGE to function sendMail is required but was not passed in.

I understand that MESSAGE is required in my component. I want it this way. I am thinking this is because I am NOT addressing the #message# variable at all in my Actionscript.

Does anybody have any ideas here?

Thanks!

Jeff Hobbs

freddycodes
07-16-2003, 12:47 AM
What is _root.message? Is it a text field? is message the instance name? If so, it should be _root.message.text. Unless of course I am missing something else here.

JeffHobbs
07-16-2003, 12:55 AM
THAT DID IT!!!

Thanks... I'm glad another pair of eyes worked here!

Jeff

JeffHobbs
07-16-2003, 01:01 AM
Any ideas now on how to capture carriage returns? In other words, if the text box has <returns> in them, I want those returns represented in the email. My text box is INPUT TEXT, MULTI-LINE, SELECTABLE, and RENDER TEXT AS HTML.

Thanks!

Jeff