This one has been fun, here is my
current code:
stop();
//this is the code that defines a variable named gatherForm which will take all the data in the fields and store them in itself
var DataSender:LoadVars = new LoadVars();
var DataReceiver:LoadVars = new LoadVars();
//code to set main variable with contained variables to bluehost
function sendForm() {
DataSender.sendtoemail = "travis@allinnia.com";
DataSender.enctype = "multipart/form-data";
DataSender.Name = form.userName.text;
DataSender.Email = form.userEmail.text;
DataSender.Message = form.userComment.text;
DataSender.Music = form.music.selectedData;
DataSender.Favorite_Track = form.cFavorite.selectedItem.label;
DataSender.sendAndLoad("http://www.allinnia.com/email.cfm",DataReceiver,"POST");
}
// function that validates form with if statement\\
this.form.submitBtn.onRelease = function() {
if (form.userName.text == "" || form.userComment.text == "" || form.music.selectedData == undefined) {
gotoAndStop("error");
} else {
sendForm();
DataSender.onLoad = function(success:Boolean) {
if (success) {
// if the server returns something
gotoAndStop("correct");
} else {
// the server never sent anything back
trace("server or connection error");
}
};
trace(form.userName.text);
trace(form.userEmail.text);
trace(form.userComment.text);
trace(form.music.selectedData);
trace(form.cFavorite.selectedItem.label);
gotoAndStop("correct");
}
};
My server uses a CGI named bluehost, and I was having problems with it sending mail all the time, I tested it repeatedly on my machine, and it would work sometimes but not always. So now I am trying to go through cold fusion mail document, and this is what I get in my output window on run.
"TRACED DATA"
Travis
travis@allinnia.com
This is not working
Positive
Other World
Error opening URL 'http://www.allinnia.com/email.cfm'
The .cfm is in the right directory, and here is what it looks like:
<cfmail>
to ="travis@allinnia.com"
from = "#Datasender.Email#"
subject = "Website Critique"
server = "mail.allinnia.com"
name : "#Datasender.Name#"
email : "#DataSender.Email#"
message :"#Datasender.Message#""#Datasender.Music#""#DataSender.Favorite_track#"
</cfmail>
I am new to Cold Fusion docs, but I am unable to find out why this problem is happening, does anyone out there have a correction or substitute for getting flash to mail form data(that works for you). This topic never seems to have one answer or format so I am eager to hear yours