PDF Editing Issues

How to Send PDF Form Data in Email Body Instead of Attachment

Phi Hung VoPhi Hung Vo Nov 24, 2026 868 views

Question details

The user wants to configure a PDF form so that clicking the submit button sends the filled text values directly inside the body of an email, rather than attaching the PDF or FDF file.

How to Send PDF Form Data in the Email Body Instead of as an Attachment
Product
PDF Editor
Device & OS
not provided
Scenario
Submitting a completed interactive PDF form and sending the extracted form data as plain text to an email address.
Observed behavior
The standard 'Submit' action only attaches the entire PDF document or an FDF/XFDF data file to the outgoing email message, leaving the email body empty.
Before you start

Ensure you have access to the PDF form's editing mode and basic familiarity with JavaScript, as standard PDF submit actions do not natively support sending text exclusively in the email body.

Solution 1Recommended

Use Custom JavaScript with app.mailMsg() to Extract and Send Data

Override the standard submit action with a custom JavaScript function that reads specific form fields and programmatically constructs an email message.

The standard 'Submit a Form' action in most PDF editors only allows you to send the whole PDF, an FDF, XFDF, or HTML file as an attachment. To send the raw text directly in the email body, you must use the JavaScript API's app.mailMsg() function to dynamically define the recipient, subject, and body text.

1
Access Button Properties

Open your PDF form in edit mode. Right-click the 'Submit' button you want to configure and select 'Properties' from the context menu.

2
Add a JavaScript Action

Navigate to the 'Actions' tab. From the 'Select Action' dropdown menu, choose 'Run a JavaScript', and click the 'Add' button to open the script editor.

3
Capture Form Field Values

In the JavaScript editor, define variables to capture the values from your specific form fields. For example: var userName = this.getField('Name').value; var userEmail = this.getField('Email').value;

4
Construct the Email Body

Create a string variable that formats these values into your desired email message structure. For example: var bodyText = 'New Submission:\nName: ' + userName + '\nEmail: ' + userEmail;

5
Execute the Mail Function

Call the mail function by pasting the following code: app.mailMsg({bUI: true, cTo: 'recipient@example.com', cSubject: 'New Form Submission', cMsg: bodyText}); then click 'OK' to save.

Use Custom JavaScript with app.mailMsg() to Extract and Send Data
Email Client Requirement: This JavaScript method requires the user completing the form to have a default desktop email client (such as Microsoft Outlook or Apple Mail) configured on their operating system to successfully draft and send the message.
Advanced PDF Editing Suite

Create, Edit, and Share Interactive Forms with WPS PDF

WPS Office includes a comprehensive PDF editor that allows you to easily design interactive forms, fill them out, and share them securely. It serves as a lightweight, highly compatible alternative to expensive PDF management software.

  1. 1. Open WPS PDF: Launch WPS Office and click on the 'PDF' module from the home screen.
  2. 2. Load Your Form: Open your existing interactive PDF form document.
  3. 3. Edit or Fill: Use the 'Form' tab to add interactive fields, or use the 'Fill & Sign' tools to complete the required data.
  4. 4. Share Directly: Click the 'Share' or 'Email' button in the top toolbar to quickly send your filled document to recipients.
Easily create, fill, and sign interactive PDF forms.Highly compatible with standard Adobe PDF formats and JavaScript APIs.Built-in sharing tools to email and collaborate on PDFs directly.Lightweight architecture with an intuitive, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Can I send PDF form data to an email without an email app installed?

No, using custom JavaScript functions like app.mailMsg() strictly relies on the user's device having a default email client properly configured. For web-based submission without an email client, the form must be configured to submit to a web server URL instead.

Why does the standard PDF Submit button send an attachment?

The default 'Submit a Form' action is designed to securely transmit complete file data (like an FDF or the entire PDF) so the recipient receives structured data that can easily be parsed, archived, or imported into a database system.

How do I extract attached FDF form responses into an Excel spreadsheet?

If you receive FDF file attachments, you can save them to your computer, open your PDF editor, and use the 'Export Data' or 'Compile Form Data' feature to merge the responses into a single CSV file, which can then be opened directly in Microsoft Excel or WPS Spreadsheet.