Fix PDF Form Button Sending HTML Email as Plain Text
Question details
User is trying to send an HTML-formatted email via a PDF form button using Acrobat JavaScript, but the recipient's email client displays the raw HTML tags instead of formatted text.

- Product
- Adobe Acrobat PDF Forms
- Device & OS
- not provided
- Scenario
- Submitting PDF form data via email using custom JavaScript.
- Observed behavior
- HTML tags within the email body appear as plain text rather than being rendered correctly by email clients like Outlook.
Verify whether your PDF form uses the mailMsg or mailDoc JavaScript methods to trigger the email, as email client behavior heavily influences how messages generated from external apps are displayed.
Format Email Body as Plain Text in JavaScript
Modify your Acrobat JavaScript to use plain text formatting instead of HTML, ensuring maximum compatibility with all email clients.
Adobe Acrobat's mailMsg and mailDoc JavaScript methods natively support only plain-text email bodies. They do not pass the necessary headers to instruct email clients like Microsoft Outlook to render the content as HTML.
Open your PDF in Acrobat, right-click the form button, select 'Properties', go to the 'Actions' tab, and edit the 'Run a JavaScript' action.
Locate the variables defining your email body in the script and remove any HTML tags like <b>, <br>, or <p>.
Replace all HTML line breaks with standard JavaScript newline characters (\n) to format your email body correctly.

Submit PDF Data to a Server-Side Script for HTML Emailing
Bypass local email client limitations by sending the form data directly to a web server that processes and sends an HTML-formatted email.
Manage Forms and Documents with WPS Office
If you frequently work with interactive PDF forms, document editing, or need an all-in-one suite to manage your workflows smoothly, WPS Office provides a lightweight, highly compatible alternative to traditional office software.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Open Your Documents: Launch WPS Office and open your Word, Excel, PowerPoint, or PDF files directly.
- 3. Edit and Save: Make your edits and save the files in their native Microsoft formats for seamless sharing.

Frequently Asked Questions
Why does Outlook show HTML tags instead of formatting them?
Outlook requires specific MIME headers to recognize an incoming string as HTML. The Acrobat mailMsg method does not provide these headers when passing data to the default email client, so Outlook treats the entire message as raw plain text.
Can I force the mailDoc function to send HTML emails?
No, standard Acrobat JavaScript API methods for email do not support HTML rendering parameters. They are strictly designed for plain text data handoffs to local mail clients.
Are there alternative ways to send interactive PDF data without plain text?
Yes. The most reliable alternative is to configure your form button to use the 'Submit a form' action, sending the data (like FDF or XML) directly to a web server. The web server can then generate and send a properly formatted HTML email.




