Skip to main content
Participant
October 29, 2006
Question

Why is my ASP formmail not working?

  • October 29, 2006
  • 1 reply
  • 285 views
Hi i have a form on my flash site, which when submitted using ASP i want it to send me a email with the form details, but i am not recieving any email and it sayts there is a error but dnt know why! Can someone please have a look? Really Urgent, I just dnt know where its going wrong. I got it to work in PHP but then found out server does not accept PHP.

this is my asp code:




<%
Dim strTo, strFName, strCompany, strEmail, strAddress
Dim objCDOMail 'The CDO object


strTo = "shush@freshlemon.co.uk"
strName = Request.Form("fname")
strCompany = Request.Form("company")
strCompany = Request.Form("email")
strAddress = Request.Form("company")



Set objCDOMail = Server.CreateObject("CDONTS.NewMail")


objCDOMail.From = "yourname"
objCDOMail.To = strTo
objCDOMail.Subject = "Medite Form"
objCDOMail.FName = strName
objCDOMail.Company = strCompany
objCDOMail.Email = strEmail
objCDOMail.Address = strAddress
objCDOMail.Send
Set objCDOMail = Nothing
%>




this is my flash script which I have on the submit button

AS

on (release) {

form.loadVariables("email.asp", "POST");
form.fname = "";
form.company = "";
form.email = "";
form.address = "";

}

/AS
This topic has been closed for replies.

1 reply

flashofscarlet
Inspiring
October 31, 2006
I'd suggest u use LoadVars instead of LoadVariables. This way, you will get more control over

Using LoadVars:
var myRespVars:LoadVars = new LoadVars();
var mySendVars:LoadVars = new LoadVars();
mySendVars.myName = name_txt.text
mySendVars.myEmail = email_txt.text
mySendVars.myCompany = com_txt.text
mySendVars.sendAndLoad("email.asp", myRespVars, "POST");
myRespVars.onLoad = function() {
result = this.result;
};

I would also suggest that you use a Response.write to notify the status - whether email has been sent/failed - in the ASP page.