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@example.com?subject=Client Info&body=";
myURL += cBody;
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?
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:
Thank you very much! I knew I was close, I was just missing something but I was able to use that tutorial to get what I needed.