2 Replies Latest reply on Apr 27, 2012 6:47 AM by danialhanson

    Attach pdf to email and use text from field in body


      I'm looking to create a fillable form with a 'submit' button at the bottom.  Upon clicking the submit button, I would like an e-mail window to open with a pre-defined recipient, and the pdf attached.  I've found code to accomplish this using this.mailDoc()




      I'm also hoping to get the text from the "Name" field of my form and use it in the body of the e-mail.

      I've found the following code in another post, which appears to work for this:


      var cClientName = this.getField("ClientName").value;

      var cAddress = this.getField("Address").value;

      var cBody = "Client Information:\n\n";

      cBody += "Client Name: " + cClientName + "\n";

      cBody += "Address: " + cAddress + "\n";

      var myURL = "mailto:email@company.com?subject=Client Info&body=";

      myURL += cBody;

      app.launchURL(myURL, true);

      That will open an e-mail window with a body containing the data from AcroForm fields named "ClientName" and "Address".


      The problem is, that this code will not attach the pdf.


      How can I get the best of both worlds?