I’m fairly new to action script and am trying to work my way through a contact form that utilizes ASP to send an email. However, my clients hosting is godaddy which i despise. I need to know if i did something wrong in the programming or if the issue is in fact with godaddy. It should be a very simple look over for any intermediates/veterans…Any help would be greatly appreciated. Thanks again!
Also, I am still beginner in working with server side scripts from flash, I know that in oreder to get this to work appropriately i need to use sendAndLoad, but, I am not familiar with the method and can’t figure out how to pass the text to ASP to get it to send.
Here is the “send button” actionscript:
on (release) {
function checkemail(email) {
var str = new String(_root.email);
var arr_email = str.split("@");
if (arr_email.length != 2 || arr_email[1].indexOf(".")<1) {
showerror("Please Enter a Valid E-Mail Address.");
return false;
} else {
return true;
}
}
function showerror(message){
_root.err = message;
}
if (_root.username != "" && _root.username != undefined && _root.phone != undefined && _root.email != "" && _root.email != undefined && _root.address != "") {
if (checkemail(_root.email)){
loadVariablesNum("postmessage.asp", 1, "POST");
_root.username = "";
_root.phone = "";
_root.email = "";
_root.address = "";
_root.err = "Thank You. Your message has been sent.";
}
} else {
trace("empty");
showerror("Please Complete All Fields Before Continuing.");
}
}
and this is the ASP code:
<%@ Language=VBScript %>
<%
Response.Buffer = true
Dim myMail, bodyText, subtext , mtext01, mtext02, mtext03 , mtext04
mtext01 = "Name:" & Request.Form("username") & vbcrlf
mtext02 = "Email:" & Request.Form("email") & vbcrlf
mtext03 = "Phone: " & Request.Form("phone") & vbcrlf
mtext04 = "Address: " & Request.Form("address") & vbcrlf
subtext = mtext04
bodyText = mtext01 & mtext02 & mtext03
Set myMail = CreateObject("CDONTS.NewMail")
if request.Form("email") = "" then
myMail.From = "No name"
else
myMail.From = request.Form("email")
end if
myMail.To = "email@host.com"
myMail.Cc = ""
myMail.Subject = subtext
myMail.MailFormat = 1
myMail.Body = bodyText
myMail.Send
Set myMail = Nothing
Response.write "DynText = send"
%>