How to Send PDF Form Data in Email Body Instead of Attachment
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.

- 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.
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.
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.
Open your PDF form in edit mode. Right-click the 'Submit' button you want to configure and select 'Properties' from the context menu.
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.
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;
Create a string variable that formats these values into your desired email message structure. For example: var bodyText = 'New Submission:\nName: ' + userName + '\nEmail: ' + userEmail;
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.

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. Open WPS PDF: Launch WPS Office and click on the 'PDF' module from the home screen.
- 2. Load Your Form: Open your existing interactive PDF form document.
- 3. Edit or Fill: Use the 'Form' tab to add interactive fields, or use the 'Fill & Sign' tools to complete the required data.
- 4. Share Directly: Click the 'Share' or 'Email' button in the top toolbar to quickly send your filled document to recipients.

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.




