Expand my Community achievements bar.

Submit form to automatically detect default email client

Avatar

Level 1

I am building a form and want it to be submitted and emailed to a specific location.  When I hit the submit button, I receive the "Select Email Client" screen.

The problem is, I will be distributing this form to a wide range of people with various skill levels.  A box like this would make their head explode!  Plus, they would probably choose "Don't Show Again" and their email choice would probably be wrong.

How can I make the form (opened in Adobe Reader) automatically detect their email, instead of asking for these options?

5 Replies

Avatar

Level 2

Hello Shipper62,

try the following script (e.g. at a click event of a button), then the XML data of the form will be attached to an email:

var Mailto = "me@myCompany.com";
var mySubject = "This is the subject";
var myMessage  = "This is the email-text .";

var Mail = "mailto:" + Mailto + "?Subject=" + mySubject + "&Body=" + myMessage;

event.target.submitForm({
cURL: Mail,
bEmpty: true,
cSubmitAs: "XML"
});

regards,

ra_be

Avatar

Level 1

I'm relatively new to this.  Can you tell me where in the default button script this should be placed?  Or if there is somewhere else that it should be placed.

Avatar

Level 2

You can place the code where you want to have the action.

I assume you would like to have the user click on a submit button. Then copy the code (and modify for your requirements) in the click event of the submit button (just a normal-standard button).

regrads

ra_be

Avatar

Level 1

Maybe we are just lost on how to add code to a button.  When we enter it after the click event, we get an error.

Where in the following string should this go?  Have tried pasting after the click event and get an error.  It would be good if you could show me what comes before and after your script.

<

field name="Button1" y="198.255mm" x="125.586mm" w="29.688mm" h="5.08mm" relevant="-print">

<

ui>

<

button/>

</

ui>

<

font typeface="Myriad Pro"/>

<

caption>

<

value>

<

text>SUBMIT BY EMAIL</text>

</

value>

<

para hAlign="center" marginLeft="0pt" marginRight="0pt" spaceAbove="0pt" spaceBelow="0pt" textIndent="0pt" vAlign="middle"/>

<

font baselineShift="0pt" size="9pt" typeface="Arial" weight="bold">

<

fill>

<

color value="255,255,255"/>

</

fill>

</

font>

</

caption>

<

border hand="right">

<

edge stroke="raised"/>

<

fill>

<

color value="255,102,0"/>

</

fill>

</

border>

<

bind match="none"/>

<

event activity="click">

<

submit format="pdf" target=mailto:email@email.com textEncoding="UTF-8"/>

</

event>

</

field>

Avatar

Level 10

You shouldn't be trying to manipulate the xml code. Use the Script Editor - ctrl-shift-f5.

Select the object that you want the script to be attached to and then enter it in the appropriate event in the Script Editor (top left dropdown menu). Also in the Script Editor make sure you have the appropriate language specified, FormCalc or JavaScript (JavaScript in this case - menu on the top right).