Other PDF Issues

Fix PDF Form Button Sending HTML Email as Plain Text

Rana GarciaRana Garcia Nov 10, 2026 869 views

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.

How to Fix PDF Form Button Sending HTML Email as Plain 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.
Before you start

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.

Solution 1Recommended

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.

1
Open PDF JavaScript Editor

Open your PDF in Acrobat, right-click the form button, select 'Properties', go to the 'Actions' tab, and edit the 'Run a JavaScript' action.

2
Remove HTML Tags

Locate the variables defining your email body in the script and remove any HTML tags like <b>, <br>, or <p>.

3
Use Plain Text Line Breaks

Replace all HTML line breaks with standard JavaScript newline characters (\n) to format your email body correctly.

Format Email Body as Plain Text in JavaScript
JavaScript Limitations: Because the native PDF JavaScript API cannot force an email client to switch to HTML rendering mode, using plain text is the most reliable built-in solution.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Open Your Documents: Launch WPS Office and open your Word, Excel, PowerPoint, or PDF files directly.
  3. 3. Edit and Save: Make your edits and save the files in their native Microsoft formats for seamless sharing.
Fully compatible with Microsoft Office and standard PDF formats.View, fill, and manage interactive PDF forms effortlessly.Lightweight design ensures fast loading and smooth performance.Free access to essential document processing tools.
microsoft office alternative - wps office

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.