PDF Editing Issues

How to Automatically Email a Completed PDF Form with Acrobat JavaScript

Algirdas JasaitisAlgirdas Jasaitis Nov 5, 2026 869 views

Question details

The user wants to configure a PDF form to automatically validate required fields and send an email upon completion using Acrobat JavaScript.

How to Automatically Email a Completed PDF Form using Acrobat JavaScript
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form that automatically submits itself or emails the completed data once the user finishes filling it out.
Observed behavior
Acrobat's security settings restrict completely automatic, silent email sending from the client side, requiring either a local email client confirmation or a dedicated external web server workflow.
Before you start

Ensure you have permission to edit the PDF form's fields and a basic understanding of Acrobat JavaScript. Note that modern PDF viewers block completely silent, background email sending to protect against malicious activity.

Solution 1Recommended

Use a Document Action Button to Trigger the Default Email Client

Add a custom JavaScript button that validates fields and securely opens the user's local email program with the completed PDF attached.

Because of strict security protocols, client-side JavaScript within a PDF cannot bypass the user's email client to send an email silently. However, you can write a script to check that all required fields are populated before invoking the 'mailDoc' function, which safely hands the document off to the default mail app.

1
Enter Prepare Form Mode

Open your PDF in Acrobat, go to the Tools menu, and select 'Prepare Form'.

2
Create a Submit Button

Add a new Button field to the document, place it at the end of your form, and label it 'Submit' or 'Email Form'.

3
Add the JavaScript Action

Right-click the button, select Properties, and navigate to the Actions tab. Choose 'Mouse Up' as the trigger, select 'Run a JavaScript' as the action, and click Add.

4
Input the Validation and Email Script

In the JavaScript Editor, enter a script that checks your required fields. If validation passes, include the command: this.mailDoc({cTo: "receiver@example.com", cSubject: "Completed Form"});

5
Test the Workflow

Save the PDF, exit form editing mode, fill out the required fields, and click the button to ensure it properly opens your default mail application.

Use a Document Action Button to Trigger the Default Email Client
User Interaction Required: The user will still need to press 'Send' in their email application (like Outlook or Apple Mail) after the PDF generates the draft.
Free Microsoft Office alternative

Fill, Manage, and Share PDF Forms Easily with WPS Office

If you are struggling with complex Acrobat JavaScript limitations or expensive software subscriptions, WPS Office offers a straightforward, user-friendly PDF solution. You can easily fill out standard PDF forms, sign documents, and share them via email without writing a single line of code.

  1. 1. Open the Form: Launch WPS Office and open your interactive PDF form.
  2. 2. Input Your Data: Click on any text field or checkbox to fill out the form using the built-in PDF reader tools.
  3. 3. Share via Email: Click the 'Share' or 'Menu' button, select the Email option, and WPS will automatically attach the completed document to a new message in your default mail app.
Fully compatible with standard Adobe Acrobat PDF forms and Microsoft Office document formats.Intuitive interface for filling out forms, adding signatures, and inserting text.Built-in seamless sharing to attach PDFs to your email client in one click.Lightweight, fast application that uses minimal system resources.Excellent free alternative for everyday document and PDF management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Acrobat ask for permission before sending the email via JavaScript?

Adobe enforces strict security protocols on client-side JavaScript. Silently connecting to the internet or sending out emails without user confirmation is blocked to prevent malicious scripts from secretly extracting data from your computer.

Can I force a PDF to send an email without opening Outlook or another email client?

Not directly through local client-side Acrobat JavaScript. To achieve this, you must configure the PDF's 'Submit Form' action to send the data to a web server URL, which can then programmatically send the email in the background.

How do I validate fields before allowing the form to be emailed?

You can write a custom JavaScript loop that checks the value of each required field. If any required field is empty, the script can trigger an app.alert() message notifying the user and then use a 'return' statement to stop the mailDoc function from executing.