1 Reply Latest reply on Oct 31, 2006 3:03 AM by flashofscarlet

    Why is my ASP formmail not working?

    shush1
      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:

      [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
      %>


      [/CODE]

      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
        • 1. Re: Why is my ASP formmail not working?
          flashofscarlet
          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.