Skip navigation
danialhanson
Currently Being Moderated

Attach pdf to email and use text from field in body

Apr 26, 2012 2:17 PM

Tags: #javascript #getfield #email_attachment

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!

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points