Other PDF Issues

How to Route PDF Form Emails to Different Recipients by Location in Acrobat

Ayan MasoodAyan Masood Nov 5, 2026 870 views

Question details

The user needs to send a submitted PDF form to dynamically determined email addresses based on a location selected within the form.

How to Route PDF Form Emails to Different Recipients by Location in Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form that automatically routes submission emails to specific regional contacts.
Observed behavior
The goal is to use JavaScript to capture the selected location and append the corresponding email address to the mailDoc function.
Before you start

Ensure your PDF form contains a correctly named dropdown or text field for the location, and verify that you have access to edit the form's JavaScript actions.

Solution 1Recommended

Use JavaScript to Route Emails Based on Location Field

Use the mailDoc method combined with if/else statements to read the location field and dynamically assign the correct recipient email.

By attaching a custom JavaScript action to your form's submit button, you can evaluate the value of a dropdown list and change the destination email address accordingly. Use semicolons to separate multiple email addresses.

1
Identify the Location Field Name

Note the exact name of your location field (e.g., 'My Company Location'). You will need this string to fetch the user's selection in the script.

2
Open Button Properties

Right-click your submit button, select 'Properties', navigate to the 'Actions' tab, choose 'Run a JavaScript' from the 'Select Action' dropdown menu, and click 'Add'.

3
Enter the Routing Script

Use 'this.getField("My Company Location").valueAsString;' to get the location. Write if/else statements assigning the matching email to a variable (e.g., if location === "Location One", extra = "person1@example.com"). Finally, use 'this.mailDoc({bUI: true, cTo: "primary@example.com;" + extra, cSubject: "Subject"});' to construct the email.

4
Test the Form

Save your PDF, select a location from the dropdown, and click the submit button. Ensure your default email client opens with the correct recipient addresses populated.

Use JavaScript to Route Emails Based on Location Field
Email Client Requirement: The 'bUI: true' parameter ensures the email client window opens for user review before sending. This requires the user to have a default email client configured on their machine.
Free Microsoft Office alternative

A Powerful, Free Alternative for Office & PDF Needs

While complex JavaScript form routing might require specialized Adobe tools, WPS Office provides a robust, free alternative for everyday PDF editing, form filling, and document management. Enjoy full compatibility with Microsoft Office and standard PDFs in one lightweight suite.

Seamlessly open, fill, and sign standard PDF forms.Fully compatible with Microsoft Word, Excel, PowerPoint, and standard PDF formats.Lightweight software that won't slow down your device.Familiar interface makes migrating from other office suites easy.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my PDF form not attaching to the email?

This usually happens if the user's device doesn't have a default desktop email client configured (like Outlook or Apple Mail), or if the PDF viewer restricts JavaScript execution for security reasons.

Can I hide the email addresses from the user?

If you set the 'bUI' parameter to false in the mailDoc function, it attempts to send the email silently in the background, though modern security settings in most PDF readers often override this and prompt the user anyway.

How do I separate multiple recipient email addresses in Acrobat JavaScript?

You must use semicolons (;) to separate multiple email addresses in the 'cTo' or 'cCc' properties of the mailDoc object. Do not use commas.

Does this script work on mobile PDF readers?

Most mobile PDF readers do not support advanced Acrobat JavaScript actions like mailDoc. This solution is generally intended for desktop environments using fully featured PDF software.