Skip to main content
Participant
January 16, 2017
Question

Java script to send email not working when using Adobe Reader

  • January 16, 2017
  • 2 replies
  • 675 views

Hope someone can help with my issue. I have a simple script attached to a button that I created using Adobe Pro DC. The Submit button has a script that sends the form to an email address specified in one of the forms fields (field is called ClientEmail). It all works fine in Adobe Pro DC but when I try and run the form in Adobe Reader XI, the following error pops up in the Java Script Debugger box when clicking on the Submit button:

=======

JAVA SCRIPT DEBUGGER

Acrobat EScript Built-in Functions Version 11.0

Acrobat SOAP 11.0

GeneralError: Operation failed.

Doc.mailDoc:20:Field Submit:Mouse Up

========

This is the Java Script I have attached to the submit button:

Action = Mouse Up

Select Action = Run a JavaScript

The script is as follows:

var cToAddr = this.getField("ClientEmail").value;

var cSubLine = "This is the subject line - test"

var cBody = "Test message body."

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
January 16, 2017

This is not a permissions issue. You don't need any special permissions to use this method in Reader XI (in earlier versions you would need the Save Rights applied to the file, but not in XI). So it's probably something else. My guess would be that either there isn't an email client set up in the application, or the email address you're trying to send it to is invalid.

Legend
January 16, 2017

Did you check the Quick Bar info for document.mailDoc? Most methods don't work in Reader so you must check each you use.