5 Replies Latest reply on Jul 1, 2007 9:48 PM by Hugh Anderson

    Can't Fix Email Form From Flash

    Hugh Anderson
      Hi,

      I was hoping that someone might be able to help me. I want to point out from the start, I know NOTHING about Actionscript!!! Somehow, with the help of a video tutorial, I was able to put together a script that allows someone who comes to my site to fill out a form and send the info to me.

      I have 3 issues.

      First, the SUBMIT button opens the users email account and loads the data into a new email - but the user still has to hit the SEND button. How do I bypass this?

      Second, the information appears in the new email as one continuous line, despite my best efforts to have it appear on separate lines. How do I arrange separate lines?

      Third, how do I get Flash to then display another frame saying something like Form Sent, Thank You, or whatever?

      As I said, if you reply to me in anything but the simplest terms, I will have no idea what you are talking about! :-) If you do reply, many thanks for taking the time to help a newbie to Actionscript. I will now attempt to attach the code. :-)

      Hugh

        • 1. Re: Can't Fix Email Form From Flash
          Retroboy_mx Level 1
          Hi Flasher!!

          Two ways to this. Use a html text and add a simple tag <br> or declare a variable
          new_line = "\n";

          That´s all and Hope this help you and Happy Flash
          ;-D - - - - { Be Fearless }
          • 2. Can't Fix Email Form From Flash
            Greg Dove Level 4
            To answer your first issue:
            Issue #1
            I'm pretty sure what you want to do is impossible. At least I hope so. It would be a big security risk if it were... anyone could use your email client to send spam if they could create the content of the email AND instruct you email client to send it as well. If you want to achieve automatic submission of the email then you really need to do it through a server side script.

            Issue #2
            For the second point... I'm not too sure. newline works fine for me as is...using windows and Outlook as the email client. Are you using a Mac, perhaps? I know there are differences between OS's for the line break characters.

            The following all works on windows for me, using Outlook - give it a try on your system:
            var urlData = "testline1"+newline;
            urlData += "testline2"+"\r";
            urlData +="testline3"+"\n";
            urlData +="testline4"+unescape("%0D%0A"); //windows CRLF
            urlData += "testline5"+unescape("%0A"); //LF only
            urlData += "testline6"+unescape("%0D"); //CR only - same as \r
            urlData +="testline7"
            getURL("mailto:some.body@something.com?subject=Venture&body="+urlData);

            Issue #3
            Well...You can't say it was sent... see issue #1...that's up to the user to press the send button in their email client's new message window. You could simply issue a
            this._parent.gotoAndStop(someOtherFrameNumber)
            after your getURL. The new frame could display instructions requesting them to press send on their email client.
            You should also be aware that there is (as far as I am aware) no way of checking whether an email client exists and whether the send message screen was displayed.
            • 3. Re: Can't Fix Email Form From Flash
              Hugh Anderson Level 1
              Hi,

              thanks so much for the info. GWD, you guessed right, I am using a Mac. (is there anything else out there??? ) :-) I really appreciate the help.

              Hugh
              • 4. Re: Can't Fix Email Form From Flash
                Greg Dove Level 4
                You're welcome. I won't get into the Mac vs. anything else debate lol.

                I guess you could use

                System.capabilities.os

                see:
                http://livedocs.adobe.com/flash/9.0/main/00001516.html#wp195419

                to check which OS is being used and output the correct EOL codes for whatever OS is being used. Perhaps MacOS (recent versions) need just the LF character.
                • 5. Re: Can't Fix Email Form From Flash
                  Hugh Anderson Level 1
                  :-) Thanks very much, I really am grateful.

                  Hugh