An alternative way of emailing form data is to use Email Form Data action.
Launch Microsoft Word. Add five text boxes by choosing Add Text Box on CenoPDF menu. Set the name of those text boxes to DestinationEmail, FirstName, LastName,Street and Comments as the following screen shot.
Choose Add Push Button on CenoPDF menu. In the Push Button Properties dialog box, click Options tab. Set the normal button text as Send Email.
Click the Actions tab, the Mouse Up trigger and the Add button.
var destEmailField = this.getField("DestinationEmail");
var firstNameField = this.getField("FirstName");
var lastNameField = this.getField("LastName");
var streetField = this.getField("Street");
var commentsField = this.getField("Comments");
var emailBody =
"First Name: " + firstNameField.valueAsString + "\n" +
"Last Name: " + lastNameField.valueAsString + "\n" +
"Street: " + streetField.valueAsString + "\n" +
"Comments: " + commentsField.valueAsString;
app.mailMsg(true, destEmailField.value, "", "", "Test Message", emailBody);
Here is the button we just added.
Export the document to a PDF file. Open it in Adobe Reader. Fill all fields. Click the Send Email button.
The email client, Microsoft Outlook in our example, pops up with the contents we just created from the PDF file.
Note: This step uses Messaging Application Programming Interface (MAPI) in your computer to open Microsoft Outlook. MAPI is a messaging architecture that allows clients (Adobe Reader) to interact with email program. In most cases, MAPI is set up automatically after an email program, such as Microsoft Outlook, is installed. In very rare cases, however, if your user's computer does not have MAPI or it is not configured correctly, it is always a good idea for you to provide alternative ways, such as fax, to send information back.
Test MAPI: Go to Windows Explorer, right click on any file and choose Send To > Mail Recipient from the context menu. If your email client opens, your MAPI is OK. Otherwise, if your email client does not open, your MAPI is probably not set up correctly and this step may not work either.