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()
However:
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?
Thanks!
You don't need launchURL to achieve that. mailDoc is capable of setting the
subject line, email body, recipients lists, etc.
See this tutorial for a detailed explanation:
http://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-ad dress
North America
Europe, Middle East and Africa
Asia Pacific