4 Replies Latest reply on Dec 7, 2007 4:26 AM by SteveH59

    Site refuses to send email

    SteveH59 Level 1

      I have a site with a contact form on it and the usual static text labels: Name, Email, Country, and Message. I bought the site from a vendor and in the instance name I can see:

      a1, a2, a3, and a4 for th Name, Email, Country, and Message fields respectively.

      I have uploaded the file and completed the online form - sending a message to myself. I have tried different scripts, such as:

      on (release) {
      loadVariables("flashEmail.asp", "POST");


      on (release) {
      loadVariables("flashEmail.asp", POST);


      formVars.send("flashEmail.asp", "_self", "POST");

      and apart from the latter I have tried then all. The latest script I have tried (this morning) is this:

      on (release) {
      loadVariables ("file.asp", 0, "POST");

      I do not want - at this stage - a 'Thank you' page or anything returned like that; all I wish to do is see my email from my Flash site in my inbox. I can work on the other issues later.

      When I press 'submit' on the stage, I have inserted these various scripts (not all at the same time!) in the Acions Panel. But when I upload the file and try to send myself a message, nothing happens. I do not get an AS error message or an error message from the server.

      I fear I am doing something fundamentally wrong, but can't think what.

      The unfinished site is here: http://stevehigham59.7host.com/flash9/graphic9.html

      Any advise, please?



        • 1. Re: Site refuses to send email
          robdillon Most Valuable Participant
          Hi Steve,

          You want to use the loadVars() method to send the data out, and to receive back the server's response. You have four input text fields that you want to use, and the instances are named a1 through 4. I'm guessing that there is also a send button there. If the send button does not have an instance name, give it one.

          Are all of these items in the same movieClip? If they are, then add a new layer at the top of the clip's timeline, name it actions.

          Add this actionscript to the first frame in that new layer.

          sendButton.onRelease = function() {
          infoToSend = new LoadVars();
          // create a loadvars object to hold the info to be sent.
          serverResponse = new LoadVars();
          // a separate instance for the reply
          infoToSend.name = a1.text;
          infoToSend.email = a2.text;
          infoToSend.country = a3.text;
          infoToSend.message = a4.text;
          infoToSend.subject = "form from site";
          infoToSend.recipient = "youremail@host.com";
          // this function will deal with the server response...
          serverResponse.onLoad = function(success:Boolean) {
          if(success) {
          // do something
          } else {
          // do something else
          // send the data
          infoToSend.sendAndLoad(" http://addressToCGI",serverResponse,"POST");

          You'll need to change the name of the send button at the top to match your send button's instance name. You'll also need to change the recipient email address so that it goes to you, and you'll need to change the address to your CGI so that the information can be processed.
          • 2. Re: Site refuses to send email
            SteveH59 Level 1
            Hello Rob

            Thank you very much for your most comprehensive reply.

            My question appears to have been misleading.

            I have an HTML page here: www.graphic9.com

            A bit primitive, I know, but the contact form works. When the site visitor complete the form, a copy goes back to him (HTML formatted), a copy goes to the Webmaster, and the data is automatically inserted into an MS Access database. An ASP file does this work.

            The site also offers a 'Thank you Rob' message after the 'Submit' button is clicked, but as I mentioned above, I am not too concerned at the moment in creating this in Flash. My priority is for the Flash form I have to be able to 'see' the ASP file that does the work referred to above.

            I have had different suggestions put to me as to how this is best done as indicated in my previous message, but none seems to work.

            This is the ASP file Flash needs to see (I think I have got it right):

            Dim fullname,email,country,message

            if Request.Form("Submit") <> "" then

            fullname = Request.Form("a1")
            email = Request.Form("a2")
            country = Request.Form("a3")
            message = Request.Form("a4")

            Server.Transfer "welcomeFlash.asp"
            End if

            If this didn't, or doesn't, work I would expect a server error message after having clicked on the 'Submit' button is my Flash site, but I get nothing. This all suggests to me that Flash cannot see the script, so it's back to basics!

            Can I just confirm with you that this is what I should have:

            1) A contact form and 'Submit' button (all contained in one symbol);
            2) The 'Submit' button appears as Static text when outlined by a blue rectangle. Please see here:
            3) The Actions Panel cannot have actions applied to it;


            Given that I have tried just about everything else, I feel certain the problem lies in something quite basic that I am not doing.

            Many thanks again for all your time.


            • 3. Re: Site refuses to send email
              robdillon Most Valuable Participant
              OK, I looked at your html version email page, email.asp. This page works because the code that you posted in the message above is integral to the form. In the Flash version, this won't be the case. From the Flash movie, you will need to send out the contents of the form fields like I described in my last message. This data needs to be sent to some sort of CGI to be transformed into streams that you describe above. You'll need to use different code. I can't help with that part.
              • 4. Re: Site refuses to send email
                SteveH59 Level 1
                Hello Rob

                I think there might be something wrong with my 'submit' button - only a guess, but it doesn't seem to be reacting at all.

                I have a couple of screen shots here if you wouldn't mind taking a look:



                Once I can be assured it is working, then I think it is a question of passing whatever is in my form fields to a script which will process them. Flash would just act as a postman, so to speak. I was using something like:

                on (release) {
                loadVariables ("flashEmailTest.asp", 0, "POST");

                Anyway, we'll see how it goes.

                Thanks for your help.