Rachel Ann
08-20-2006, 11:58 PM
Okay here we go. Scratch what I asked about PHP earlier. I got my people to change the server. Now I have a different problem. And this is so confusing.
So we (Cota) got the ASP and AS to work last time with the server I was testing on. This is what is happening now:
I click send, and it say "Email sent" in the status box (so it reads the ASP) but it doesn't send the e-mails.
So you may be thinking...oh, well the new server has a problem with the ASP. But, I tried the the simple tuturial flash and it works...on the exact same ASP file in the exact same location.
So then I thought maybe the AS wasn't working right, but nope. If you direct it towards the first server I used it works. AND when I put the exact same AS in my flash file into the tutorial file, it sends the e-mail.
So it seems as if the ASP file works and the AS works, but not together on the new server.
Does this make sense? What in the world is going on here?
Here is what I am using:
AS:
//Create a loadvars object named email_lv
var email_lv = new LoadVars();
//this function is called when email_lv loads the server-side script.
email_lv.onLoad = function(success) {
//If the script was successfully loaded, this condition is run
if (success) {
if (email_lv.server_mes == "ok") {
status_txt.text = "Email Sent";
}
} else {
//email failed to send, but script did load. Likely a server issue.
status_txt.text = "Email Failed";
}
};
submit_btn.onRelease = function() {
if (!email_txt.length || email_txt.indexOf("@") == -1 || email_txt.indexOf(".") == -1) {
status_txt.text = "Invalid Email.";
//This validates the subject line contains text
} else if (!name_txt.length) {
status_txt.text = "Missing Name";
//This validates the message body contains text
} else if (!phone_txt.length) {
status_txt.text = "Missing Phone";
} else if (!message_txt.length) {
status_txt.text = "Missing Message";
} else {
email_lv.email_txt = email_txt.text;
email_lv.name_txt = name_txt.text;
email_lv.phone_txt = phone_txt.text;
email_lv.message_txt = message_txt.text;
email_lv.sendAndLoad("http://www.thehousenlr.com/SendMail.asp", email_lv, "POST");
}
};
stop();
ASP:
<%
dim themail, thename, themessage, i
'Gets the incoming variables from flash
themail = Request("email_txt")
thename = Request("name_txt")
thephone = Request("phone_txt")
themessage = Request("message_txt")
'Decalre and create email object
dim objmail
set objmail = Server.CreateObject("CDONTS.Newmail")
'error handler, if error encountered, ignore it and proceed
On Error resume next
'build the email using the variables from flash
objmail.From = themail
objmail.To = "[email protected]"
objmail.Subject = "Email from thehouse website"
objmail.Body = "The following is a message from " & thename & " (phone number " & thephone & ") from thehouse website: " &themessage
objmail.Send
'error handler, if error encountered, ignore it and proceed
On Error resume next
'If any errors were encounter then run this code
If Err.Number <> 0 then
'tells flash ASP failed and terminates the ASP file.
Response.Write "&server_mes=fail"
Response.End
else
'Send message back to flash saying everything was ok.
Response.Write "&server_mes=ok"
End if
%>
So we (Cota) got the ASP and AS to work last time with the server I was testing on. This is what is happening now:
I click send, and it say "Email sent" in the status box (so it reads the ASP) but it doesn't send the e-mails.
So you may be thinking...oh, well the new server has a problem with the ASP. But, I tried the the simple tuturial flash and it works...on the exact same ASP file in the exact same location.
So then I thought maybe the AS wasn't working right, but nope. If you direct it towards the first server I used it works. AND when I put the exact same AS in my flash file into the tutorial file, it sends the e-mail.
So it seems as if the ASP file works and the AS works, but not together on the new server.
Does this make sense? What in the world is going on here?
Here is what I am using:
AS:
//Create a loadvars object named email_lv
var email_lv = new LoadVars();
//this function is called when email_lv loads the server-side script.
email_lv.onLoad = function(success) {
//If the script was successfully loaded, this condition is run
if (success) {
if (email_lv.server_mes == "ok") {
status_txt.text = "Email Sent";
}
} else {
//email failed to send, but script did load. Likely a server issue.
status_txt.text = "Email Failed";
}
};
submit_btn.onRelease = function() {
if (!email_txt.length || email_txt.indexOf("@") == -1 || email_txt.indexOf(".") == -1) {
status_txt.text = "Invalid Email.";
//This validates the subject line contains text
} else if (!name_txt.length) {
status_txt.text = "Missing Name";
//This validates the message body contains text
} else if (!phone_txt.length) {
status_txt.text = "Missing Phone";
} else if (!message_txt.length) {
status_txt.text = "Missing Message";
} else {
email_lv.email_txt = email_txt.text;
email_lv.name_txt = name_txt.text;
email_lv.phone_txt = phone_txt.text;
email_lv.message_txt = message_txt.text;
email_lv.sendAndLoad("http://www.thehousenlr.com/SendMail.asp", email_lv, "POST");
}
};
stop();
ASP:
<%
dim themail, thename, themessage, i
'Gets the incoming variables from flash
themail = Request("email_txt")
thename = Request("name_txt")
thephone = Request("phone_txt")
themessage = Request("message_txt")
'Decalre and create email object
dim objmail
set objmail = Server.CreateObject("CDONTS.Newmail")
'error handler, if error encountered, ignore it and proceed
On Error resume next
'build the email using the variables from flash
objmail.From = themail
objmail.To = "[email protected]"
objmail.Subject = "Email from thehouse website"
objmail.Body = "The following is a message from " & thename & " (phone number " & thephone & ") from thehouse website: " &themessage
objmail.Send
'error handler, if error encountered, ignore it and proceed
On Error resume next
'If any errors were encounter then run this code
If Err.Number <> 0 then
'tells flash ASP failed and terminates the ASP file.
Response.Write "&server_mes=fail"
Response.End
else
'Send message back to flash saying everything was ok.
Response.Write "&server_mes=ok"
End if
%>