How to Add Multiple CC Addresses in Acrobat PDF JavaScript
Question details
The user wants to configure the mailDoc JavaScript function in a PDF to draft an email with multiple recipients in both the To and CC fields.
- Product
- Adobe Acrobat PDF
- Device & OS
- not provided
- Scenario
- Writing or troubleshooting PDF JavaScript to automatically trigger an email to several contacts simultaneously.
- Observed behavior
- To execute the mailDoc function successfully, multiple email addresses must be formatted precisely without invalid separator characters like spaces or parentheses.
Ensure you have access to edit the interactive form fields or JavaScript properties of your PDF document, and verify that your default desktop email client is correctly configured.
Format mailDoc Parameters with Semicolons
Correctly structure the JavaScript parameters by enclosing semicolon-separated email addresses in a single set of quotation marks.
When using the mailDoc function in Acrobat PDF JavaScript, exact formatting is critical. The script will fail if commas, spaces, or parentheses are used incorrectly to separate recipients.
Open the PDF document in your PDF editor, navigate to the interactive element (such as a submit button), and open its Properties. Go to the Actions tab and select 'Run a JavaScript'.
Place all intended email addresses for a specific parameter (like cTo or cCc) within a single set of quotation marks. Do not use parentheses.
Separate each email address using a semicolon without any spaces after the semicolon (e.g., "user1@domain.com;user2@domain.com").
Set the bUI parameter to true while troubleshooting so that the application displays the email client's dialog box. If set to false, the cTo parameter becomes strictly required for the email to generate silently.

Create and Manage Interactive PDFs with WPS Office
WPS Office features a robust PDF editor that simplifies managing interactive PDF elements, editing text, and streamlining document workflows without the need for complex programming.
- 1. Download and install: Get WPS Office from the official website and install it on your device.
- 2. Open your PDF: Launch WPS PDF and open the document you wish to edit or manage.
- 3. Edit and configure: Use the 'Form' tab to add interactive form fields, or navigate to the 'Edit' tab to seamlessly modify PDF text, links, and images.

Frequently Asked Questions
Why is the mailDoc function failing to open my email client?
This can occur if your operating system does not have a designated default email client, or if the bUI parameter in your script is set to false without providing a valid email address in the cTo parameter.
Can I use spaces after the semicolons in the email list?
No, it is highly recommended to format the addresses without spaces after the semicolons (e.g., "email1@test.com;email2@test.com") to prevent parsing errors in various email clients.
Are the cTo and cCc parameters strictly required?
According to the JavaScript for Acrobat API Reference, if the bUI parameter is set to false, the cTo parameter is absolutely required. The cCc, cBcc, cSubject, and cMsg parameters are always optional.




