Link to home
Start Free TrialLog in
Avatar of d_springer
d_springer

asked on

Email submission button on Adobe Acrobat 6 form

I use Adobe Acrobat forms on my website.  I want to add to the forms a submit button that will email the form back to me complete with the information.  How can I do this?   I am relatively Adobe Acrobat savvy but I have no clue where to start (i.e. I will need step by step instructions).

Thanks in advance!!!
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

I assume that your clients will use the free Reader, in this case "Submit" does not mean sending by email, it means submitting to a web server. Reader also cannot send the PDF with the form data, it can only submit the forms data. How familiar are you with CGI programming? You can use the same CGI script on your server that you would use for a web form. Reader can use the same forms submission mechanism as a browser, so in case you have a web based forms solution, it's very easy to convert this to a PDF forms based solution.

You can also submit the forms data as FDF file. If you open this FDF file, it will automatically (if created correctly) open the associated PDF file and fill in the forms fields with the data form the FDF file.

With the full version of Acrobat, you can submit forms data via email, and you can also submit the full PDF with the forms data.

Avatar of d_springer
d_springer

ASKER

You are right most of my visitors are going to be using the free reader.  I thought that they would be able to at least save the form data and email it back to me.  I find it stupid that Adobe makes this an unusable option unless you have the pay version.

Currently I am hosted on a Linux server and use Formail for my web based forms.  Regarding my programming knowledge - Let's just say I was thrilled when I got my Formail.pl script to work.

I did a little research on FDF and came across http://forums.devshed.com/showthread.php?t=71168&page=2 it seems they are trying to work through a similar issue to mine.

Is it a hard process to setup the forms to be emailed back to me with the data saved in them or is that not going to happen using the free reader?  If not is there another option that I can use with a limited programming knowledge?

Thanks for all your help!
Maybe you misunderstood: The feature is not useless, you can submit forms data to a web server. This is actually the better solution in an environment where you don't have control over the email setup. Do you know that all of your users have configured their local email system? There are enough users out there that only use web mail like hotmail.com or Yahoo mail. Your solution would not work for these users. More important, they may have some email setup on their local machines, which means that it looks like the email was submitted, but never will make it to a server on the Internet. When the form gets submitted back to your server, you know right away that it did work.

If you are already using Formmail, just use it with the PDF forms. All you need to do is configure the submit button for HTML submission of the forms data and specify the URL of your FormMail address. To let FormMail know where to send the email to, you need to create a hidden form field named "recipient" on your PDF form.
If you want to pass in more information, you need to create more hidden fields (e.g. for the subject field).
I am really glad to hear that I haven't spent several hours configuring all my Adobe Acrobat pages for nothing.

Within Adobe Acrobat 6.0 how do I "configure the submit button for HTML submission of the forms data and specify the URL of your FormMail address"?

Thanks!!!
Create a new button on your form. When you place the button, the properties window will open. Select the "Actions" tab. From the "Select Action" list select the "Submit a Form" entry and click on the "Add" button.
This will bring up a dialog that lets you set the details for the forms submission. You have a choice of what actually gets submitted: FDF, HTML, XFDF or the complete PDF. When you select HTML, you can use FromMail, because the submission method is exactly the same that would be used by a web form. So, select HTML and then go to the URL field and specify the path to your FormMail page.
Don't forget to create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email.
To create a hidden text field select the text field tool and create a new text field. On the properties dialog select the "General" tab. In the Common Properties group box select "Hidden" from the "Form Field" list. Check the "Read Only" checkbox, so that it cannot be modified by accident.
HERE IS WHERE MY LACK OF PROGRAMMING KICKS IN....................

I added the button exactly as you said.  When I click on the button I get:

"General Error    http://www.sovereignfunding.com/formail.pl".

I don't know if this is part of the problem but when I enter http://www.sovereignfunding.com/formail.pl into my browser I get the error page:
=====================================================================================================
Forbidden
You don't have permission to access /formail.pl on this server.
--------------------------------------------------------------------------------
Apache/1.3.29 Server at www.sovereignfunding.com Port 80
=====================================================================================================



Regarding the second part:
=====================================================================================================
Don't forget to create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email.
To create a hidden text field select the text field tool and create a new text field. On the properties dialog select the "General" tab. In the Common Properties group box select "Hidden" from the "Form Field" list. Check the "Read Only" checkbox, so that it cannot be modified by accident.
=====================================================================================================


In relation to the submit buttor where do I "create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email."   I am really unsure specifically what to do here.

Many Many Sorry's for my lack of knowledge on all of this!
Looks like we are using two different packages: formail.pl vs. FormMail.pl (one 'm' vs. two 'm'). When you first typed formail.pl, I assumed that this was a typo, but I know checked, and there really is a formail.pl, which I'm not familiar with.
I need some time to get familar with formail.pl before I can give you any more advice. Unfortunately, I won't have time for this until tonight.
OOPS!

I used the wrong FormMail.pl.  The correct one is located here: http://www.sovereignfunding.com/cgi-bin/FormMail.pl.

When I put in the correct url into the Adobe Acrobat Submit Button I got the error message:

Error: Bad/No Recipient
There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure
you have filled in the recipient form field with an e-mail address that has been configured in
@recipients. More information on filling in recipient form fields and variables can be found in
the README file.
FormMail V1.92 © 1995 - 2002 Matt Wright
A Free Product of Matt's Script Archive, Inc.

This must be the second part of the equation that I haven't done yet.
I recognize this error message :-)

You are correct, this is about the second part of my comment. For testing purposes, it's not important that you hide your text field, so just create a new text field on your form (anywhere, any size). When the properties dialog comes up, go to the "General" tab and type the string "recipient" (without the quotes) into the "Name:" field. Then go to the "Options" tab and type your email address into the "Default value:" field.
FormMail will check the form data that is posted for certain field names (e.g. recipient, subject, ...) and will use this information when it generates it's email message.
Once you've made this change, you should be able to send the forms data to your email account.
It worked.

Two final questions.

1) Is there a way to change the default page that appears after the page has been successfully been sent?

2)  Is there any way that the form can be sent intact or easily repopulated back into Acrobat to save me from having to do it manually?  The main reason for my forms were to have a method of having the applications filled out by the client rather than me having to do it.

1) Create another hidden form field named "redirect" and set the value to the URL you want to use as your "thank you" page.
2) Yes, this is what FDF is for. Try this: Copy your PDF form to your local machine (e.g. to your Desktop) and fill out the form field. Don't click on the Submit button, but select the "Advanced>Forms>Export Forms Data" menu item in Acrobat Professional. Save this file to the Desktop as well. Close Acrobat and double-click on the FDF file. This will bring up Acrobat, will load your PDF file and will initialize the form fields with the data from the FDF file. As you may remember, you can also submit the full FDF file to the server (and mail this as an email attachment to you). You can also import a FDF file into your open PDF document (Advanced>Forms>Import Forms Data), so that you don't have to close the already open PDF document just to read the forms data. If this is what you want, you need a different CGI script on your server. Do you have PHP installed? The link that you posted earlier does exactly this with a PHP script.
BTW: This page http://www.nethere.com/support/webhosting/unofficial-guide-formmail.html lists all the things you can customize (with examples) in FromMail.pl
In my simplistic dreams I had envisioned receiving an email with an attachment that contained the clients data filled out just as they typed it in on my form.

In your opinion which of your above methods would provide that or close to that?
Sorry,  Yes PHP is installed.
The FDF solution will let you recreate the filled in form (based on the original PDF, merged with the FDF data).
If you use the PHP script found here http://forums.devshed.com/showpost.php?p=382992&postcount=24 and configure it and save it to your web site (e.g. as /FDFMail.php), you can then change the forms submission type to FDF and use the FDFMail.php script as your CGI handler.
This will forward the complete FDF file to your email account. Once you receive that, you can import it into your PDF file and it will look exactly like the form looked like when your client submitted it.
khkremer,

This is what I have done.

1) In the Adobe Acrobat Form I changed the SUBMIT button Actions to
a) Enter a url for this link: http://www.sovereignfunding.com/cgi-bin/FDFMail.php
b)Export format: FDF Include with field data checked

2) I made minor changes to the script below but I know that I probably have left items out.

When I open the form here: http://www.sovereignfunding.com/test.htm and press the submit button I get this error:
=================================================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@sovereignfunding.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.29 Server at www.sovereignfunding.com Port 80

The PHP script I am using is below:
=================================================
<?php
// $form_name is provided in the url that calls this page, allowing this page
// to be called from different PDF's, yet customized for each one
$date = (date ("m/d/y"));
$time = (date ("H:i:s T"));
$tmpname = (date ("mdy-His"));

$message = '
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

A '.$form_name.' was submitted from the sovereignfunding.com website at '.$time.' on '.$date.'.

(attachment: '.$form_name.')

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: application/vnd.fdf;
    name="FDF-'.$tmpname.'.fdf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
    filename="FDF-'.$tmpname.'.fdf"

'.$HTTP_RAW_POST_DATA.'

------=_NextPart_000_0007_01C37EC6.3F062EA0--

';

$recip = "funing_quote@sovereignfunding.com";
$subject = $form_name;
$headers = "From: xxxxx <xxxxx@xxxxx.com>\n";
$headers .= "Return-Path: <xxxxx@xxxxx.com>\n";
//use the following line for bcc:
//$headers .= "bcc: [email]xxxxx@xxxxx.com[/email]\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"----=_NextPart_000_0007_01C37EC6.3F062EA0\"\n";

$status = mail($recip, $subject, $message, $headers);

Header("Location: nextpage.php");
=================================================

Can yo tell me what I have done wrong.

MANY THANKS!!!!!

David
Your script needs to end with a line like this:
?>

This is missing from the script you posted. It may just be a cut&paste error, but this may also be the reason for your problem. Before we go any further, please verify that you do have the correct last line in your script.
khkremer,

I added the ?> to the last line.  Then I held by breath and pressed Submit but the same exact error occured.  It is never that easy is it?

David
khkremer,

I checked my servers error.log and this is what is said:
[Sun May  2 15:43:27 2004] [error] (13)Permission denied: exec of /vservers/sovereignfun/cgi-bin/FDFMail.php failed
[Sun May  2 15:43:27 2004] [error] [client 68.55.19.165] Premature end of script headers: /vservers/sovereignfun/cgi-bin/FDFMail.php

Here is the script:

<?php
// $form_name is provided in the url that calls this page, allowing this page
// to be called from different PDF's, yet customized for each one
$date = (date ("m/d/y"));
$time = (date ("H:i:s T"));
$tmpname = (date ("mdy-His"));

$message = '
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

A '.$form_name.' was submitted from the sovereignfunding.com website at '.$time.' on '.$date.'.

(attachment: '.$form_name.')

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: application/vnd.fdf;
    name="FDF-'.$tmpname.'.fdf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
    filename="FDF-'.$tmpname.'.fdf"

'.$HTTP_RAW_POST_DATA.'

------=_NextPart_000_0007_01C37EC6.3F062EA0--

';

$recip = "funding_quote@sovereignfunding.com";
$subject = $form_name;
$headers = "From: xxxxx <xxxxx@xxxxx.com>\n";
$headers .= "Return-Path: <xxxxx@xxxxx.com>\n";
//use the following line for bcc:
//$headers .= "bcc: [email]xxxxx@xxxxx.com[/email]\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"----=_NextPart_000_0007_01C37EC6.3F062EA0\"\n";

$status = mail($recip, $subject, $message, $headers);

Header("Location: nextpage.php");
?>

ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
khkremer - THANKS!!!
I assume it worked :-)
khkremer,

I am having a minor problem with the script.  I posted the issue in the PHP section.  Maybe you will have some idea what the problem is.


https://www.experts-exchange.com/questions/20975595/Adobe-Acrobat-Form-Mail-Script-Acting-Strangely.html
Looks like you figured it out. My PHP experience is very limited, so my suggestions may not have helped you :-)
If you have any problems with the PDF/FDF part of your solution, please feel free to post our followup questions in this question.