2 Replies Latest reply on May 19, 2011 3:58 AM by Darshan Rane

    Setting up mail in Flash CS4

    jaysondking Level 1

      I want to set up mail in my Flash site. The only thing I can figure out is to have someone fill out a form and click button for it to open in their email browser with forms filled out.


      I purchased my site name from GoDaddy and am using a free server to host. GoDaddy provided me with one email address. I would like to send the data to this email account with the click of the button instead of opening someones email browser. An even bigger "dream" would be the ability to attach a file to the email from my form.


      My code I have now is below. If it helps the email address is jk@jaysondking.com. Thank you so much in advance!


      enter_btn.addEventListener(MouseEvent.CLICK, sendData);


      function sendData(evtObj:MouseEvent):void{

      trace (name_txt.text);

      trace (email_txt.text);

      trace (message_txt.text);

      var theEmail:URLRequest = new URLRequest("mailto:jk@jaysondking.com?from="+email_txt.text+"&subject=From Website&body="+message_txt.text+"   from:"+name_txt.text);



        • 1. Re: Setting up mail in Flash CS4
          Ned Murphy Adobe Community Professional & MVP

          When you prcess a form on a web site you need some form of server-side script to process the form and send it to whatever destination is intended.  PHP is one of the more common languages supported by host servers.  So you end up needing to submit your form to such a script so that it can be processed and result in email(s) being sent and/or data being saved into some form of database.


          There's two things you'll want to look into... the first being if your site host provides PHP support for your account, if so, they may even provide a mail processing script that you can use.  I don't know if you will get such features with a free account though.  The second being to Google terms like "AS3 PHP form tutorial" and/or "AS3 PHP email tutorial" so hat you can learn how to make things work.


          PS - you might want to see if you can get the attention of a forum moderator to see if you can have your email address removed from the posting.  It is not a good idea to advertise your email in a public forum.

          1 person found this helpful
          • 2. Re: Setting up mail in Flash CS4
            Darshan Rane Level 3

            Check this, source code available, feel free to use it.



            1 person found this helpful