Flash form to email problems

Hiya! I’m quite new to actionscript, but have quite a solid background in javascript/coldfusion. Now I know most of the stuff here is PHP based, but any help I can get in resolving this issue would be gratefully received…

Basically I have a flash form which submits to a coldfusion template which then emails it to a recipient. The problem is that the emails are hit and miss- literally hit and miss- sometimes it works, other times it just disappears- nothing in the mail spool (the server’s a windows 2k machine), and the coldfusion mail log shows no evidence of receiving the request to send an email; naturally I’ve tested the coldfusion template on it’s own, and it works consistently, sending me a test email every time…

Which leads me to thing that it’s the flash that’s not doing it’s job; below is the actionscript applied to the button which submits the form. Is there some way to ‘trace’ whether or not the flash successfully transmitted the data to the coldfusion template, and if not, to try and tell me what the problem is?


on(release){
	**Long winded code involving the creation of an array of form field s and their values, called arrForm**

	var errorVar = false;
	
	for(i=0; i<arrForm.length; i++){
		if(arrForm*[0] == false){
			// set a flag to show there's been an error.
			errorVar = true;
			//set the error box to show that there's been a submission error.
			theForm['errorMessage' + i] = arrForm*[1];
		}else{
			//set it to 'true';
			theForm['errorMessage' + i] = '';
			
		}
	}

	var email = theForm.emailAddress.text;

	if(errorVar == false){
		//check that the email is Valid:
		if (email.indexOf(" ") != -1 || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
			trace('invalid Email address');
			theForm['errorMessage4'] = arrForm[4][1];
		}else {
			
			var sender = new loadVariables();
			//if all is well, send the post.
			sender.firstName = theForm.fName.text;
			sender.lastName = theForm.lName.text;
			sender.companyName = theForm.company.text;
			sender.telephoneNumber = theForm.telephone.text;
			sender.emailAddress = theForm.emailAddress.text;
			sender.comments = theForm.comments.text;
			
			theForm['errorMessage4'] = '';
			sender.send("contactUs.cfm", "_blank", "POST");
			gotoandstop(2);
		}
	}else{
		trace('form not completed');
	}
}


You’ll note that I use ‘sender.send’- this was a recent change from the loadVariables() method I used- but sender.send seems to work haphazadly as well… Thanks guys for taking an interest in this thread- any insights would be gratefully accepted. This all seemed so straightforward when I started :blush:.

Thanks again,
Andy