3 Replies Latest reply on Jan 7, 2008 7:19 AM by kglad

    email return data formating

    pow_haaweeese Level 1
      hi all,
      I'm building a basic "contact me" email return page, and it's working...at least partially.
      (that's the good news)

      the "bad" news is..
      when I fill in the above blanks in the swf, and click send, it opens my email ("mail"-mac) and populates my correct email address, but then puts ALL the information, not just the subject line info, in the subject window. Is there a way to tell the code to put the subject line "jb3_contact" in the subject of the email, and then "tab" to the body area of the email to dump their name, email, and message?

      what my email subject line looks like: (what I typed into the swf fields)
      Subject: jb3_contact:= Name: jim Email: jimsbook.com Message: hey dork...

      I guess I'd like the subject line to be "jb3_contact" ONLY. and their message info in the "body" area of their email.
      like:
      Name: Jim
      Email: jimsbook.com
      Message: hey dork...

      text field instances:
      name [ iptxt_name ]
      email [ iptxt_email ]
      msg [ iptxt_msg ]

      I'd appreciate any thoughts...

      best,
      pow


      following code on the "send" button:

      [code]//email send button info, for "contact me" area

      on (press) {

      // these statements simply read the data from the input fields
      // and print them to the output window for debugging

      trace(this.iptxt_name.text);

      trace(this.iptxt_email.text);

      trace(this.iptxt_msg.text);

      // save the return email address

      returnEmail = this.iptext_email.text;

      // create an empty string variable to store the data

      urlData = "";

      // assemble the data from the fields into the new variable

      urlData += " Name: "+this.iptxt_name.text+newline+" ";

      urlData += " Email: "+this.iptxt_email.text+newline+" ";

      urlData += " Message: "+this.iptxt_msg.text+newline+" ";

      // print url data to output window for debugging

      trace(urlData);

      // send email using user input data

      getURL("mailto:jim@jimsbook.com?subject=jb3_contact="+ urlData);

      }

      //>>>>>>>>>>>>>>[/code]
        • 2. Re: email return data formating
          pow_haaweeese Level 1
          hello kglad,
          thank you very much for this, adding your line alone with one other addition did exactly what I needed.

          other added line:
          "Add another variable(body in this case) in the mailto and use "%0A" instead newline"
          (see code below)
          ...that did exactly what your code did, with basically a carriage return, between for readability.

          the email send executed perfectly:

          subject (in the subject line, all by itself)
          and then:
          "Name: Jim lastName
          Email: jim.contactme@some.com
          Message: hey Jim how come you're such a dork? "
          all stacked, and clear in the body area.

          Thank you very much kglad.

          best,
          Pow.

          code below is to create a return email from a "contact me" form you build in flash.

          input text fields have instance names of as follows:
          name ( iptxt_name )
          email ( iptxt_email )
          message ( iptxt_msg )

          last line of code just has my email I want it to go to, along with what I want in the subject line "jb3_contact"

          hope this helps someone else.

          <final code>
          //email send button info, for "contact me" area
          on (press) {

          // these statements simply read the data from the input fields
          // and print them to the output window for debugging

          trace(this.iptxt_name.text);
          trace(this.iptxt_email.text);
          trace(this.iptxt_msg.text);

          // save the return email address

          returnEmail = this.iptext_email.text;

          // create an empty string variable to store the data

          urlData = "";

          // assemble the data from the fields into the new variable

          urlData += " Name: "+this.iptxt_name.text+"%0A";
          urlData += " Email: "+this.iptxt_email.text+"%0A";
          urlData += " Message: "+this.iptxt_msg.text+"%0A";

          // print url data to output window for debugging

          trace(urlData);

          // send email using user input data

          getURL("mailto:jim@somewhere.com?subject=jb3_contact&body="+ urlData);


          }


          <end_code>
          • 3. Re: email return data formating
            kglad Adobe Community Professional & MVP
            you're welcome.