9 Replies Latest reply on Feb 12, 2014 12:47 PM by smtasci

    Adding text field data to mailto

    danielle.coulombe

      I designed a form that the user will fill in and save to our server.  The form will contain a field that he will fill in his email address.   I want to design a button that once clicked will open an email with his email address populated from that text field.  Can that be done?  Do I need to use javascript, if so what code would I use?

        • 1. Re: Adding text field data to mailto
          George_Johnson MVP & Adobe Community Professional

          It's not clear to me what you want. When you say save to your server, what type of server are you talking about, Web server, email server, file server, Sharepoint server, something else?

           

          So the user enters an email addressing a text field, but now you're wanting to sending an email. Is the email address in the text field for the From address, the To address, Cc, Bcc, something else?

          • 2. Re: Adding text field data to mailto
            danielle.coulombe Level 1

            Sorry,

             

            The server is a file server.  This form is a marking guide for an elearning course.  Once completed by a user the pdf form is saved to our server (which the marker has rights to) and a marker would open the document, mark their work, give the user a mark and then by clicking on a send button the email would be populated with the user's email address in the To field. 

             

            The form has a field called YourName and that is the field that I want to be populated in the TO field of the email.

             

            Hope this makes more sense.

             

            Thanks!

             

            Danielle Coulombe

             

            Methods and Procedures Officer

             

            5th Floor, Bowker Building

             

            9833 - 109 Street

             

            Edmonton, Alberta  T5K 2E8

             

             

             

            Phone:  780-644-8887

             

            Fax:  780-422-6613

             

             

             

            Danielle.Coulombe@gov.ab.ca

             

             

             

            Please don't print this e-mail unless necessary. 

             

            Think green.

            • 3. Re: Adding text field data to mailto
              try67 MVP & Adobe Community Professional

              You can use something like this:

               

              address = this.getField("YourName").value;
              if (address!="")
              this.mailDoc({bUI: true, cTo: address, cSubject: "You can enter the  email's subject here", cMsg: "Here you can enter the main text of the  email"});
              else app.alert("Can't send an email because the address field is empty.");

              • 4. Re: Adding text field data to mailto
                danielle.coulombe Level 1

                Thank you!  This is perfect.  I even added the code to copy the

                supervisor and added the person's name in the subject

                 

                 

                 

                address2 = this.getField("SupEmail").value; if (address2!="")

                 

                name =  this.getField("Full Name") value, if (name!= "")

                 

                 

                 

                ... cCc:address2, cSubject: name + "You can enter the email'subject

                here", ...

                 

                 

                 

                Thank you.

                 

                 

                 

                You can use something like this:

                 

                 

                 

                address = this.getField("YourName").value;

                 

                if (address!="")

                 

                this.mailDoc();

                 

                else app.alert("Can't send an email because the address field is

                empty.");

                • 5. Re: Adding text field data to mailto
                  smtasci Level 1

                  Hello,

                   

                  I'm looking to do a similar thing but send an SMS message rather than an email.

                   

                  Is this possible?

                   

                  I've looked online but couldn't see any app methods such as app.SMS rather than app.mailMsg.

                   

                  Thanks,

                   

                  Sabri

                  • 6. Re: Adding text field data to mailto
                    George_Johnson MVP & Adobe Community Professional

                    There is no way to send an SMS message from a form. An SMS URI scheme has been proposed, but it's not supported buy Acrobat/Reader. It would be possible to submit to a web server that does the job of sending the SMS.

                    • 7. Re: Adding text field data to mailto
                      smtasci Level 1

                      That's a shame. We currently have a SMS service that we use through Outlook. I was hoping to incorporate it in to the form the same way we use the mailto feature.

                       

                      Submitting to a webserver would just skip the need for Outlook right?

                       

                      Thanks

                      • 8. Re: Adding text field data to mailto
                        George_Johnson MVP & Adobe Community Professional

                        Right. The web server would have to be able to communicate with an SMS gateway and return a response to the PDF form.

                        • 9. Re: Adding text field data to mailto
                          smtasci Level 1

                          Thanks for your help!