We help IT Professionals succeed at work.

Acrobat 8 Pro, submit form via email

redmanjb asked
I have a form I developed in Acrobat 8 Pro (well, several forms), and I created a "submit to email" button, checking the box to submit the entire PDF.  I enabled reader usage rights, removed all security, and did the "distribute forms" command.  This form is on our website, and staff members, who have versions of Adobe Reader ranging from 5 to 8, will be filling out and submitting the form to one email address.  

I tested out the form, and upon clicking the submit button, a new email message automatically opens up with the completed PDF attached.  While testing from another computer that also has Acrobat 8 installed, and from a computer that has Reader 7 installed, upon clicking the submit button, a window pops up asking if the user has a desktop email application or an internet email application, and provides a "save as" button so the user can save it, start a new email, and attach the PDF.  I'm afraid this is going to be way too complicated for some of our users.

I was wondering if I could use a script that will automatically send the PDF to the email address specified.  I did a little researching on this, and found that this could be done via PHP (Pear?).  I do have PHP installed on our webserver (where the PDF forms live), but have no idea how to do PHP.  I did find some PHP scripts, but have no idea on what to do with those scripts, or what modifications would be needed.

I don't need to create PDFs with scripts or anything, as the PDFs are already created and fillable.  I really don't want to have to do a bunch of editing of PHP scripts, as we have a lot of PDFs that we have online, and would like to have to ability to send them to an email address.

I would like to utilize the "distribute forms" function, so that the data could be saved in a PDF dataset, but I don't know how this could be done while using PHP to handle the sending of the data.

If someone knows of a simple tutorial that would be easy for us non-programmers, that would be wonderful.  Thanks for the help!
Watch Question

b0lsc0ttIT Manager


So will the files exist on the web server that can run PHP?  You just want to send the files as an attachment right?

This would be basically done with the mail() function in php.  There is some good info and sample code at http://us3.php.net/manual/en/function.mail.php .  There is some other general info at http://us2.php.net/mail .

You do need a pretty good understanding of emails and their headers to use that function though.  If you want an easier method then look at http://phpmailer.codeworxtech.com/ .  It will also use PHP and send emails but is a little easier to use, especially emails that aren't just basic emails.  You would need to be able to add that to your web server though unless it already supports it.

This info should get you started.  Let me know if you have any questions or need more information.  Please respond to my questions above to make sure I understood this correct and let me know how much help you will need with PHP and making an email.



Thank you very much for the reply b0lsc0tt!  I'll take a look at the links in a few.  

I "think" I may have found the reason why the "Select Email Client" window had popped up...maybe because I first began the form using Adobe Designer?  I looked at a few of the other forms I have on my site, which were created using Acrobat itself, and they do not show that message.  I logged onto my home computer remotely, opened up a different form (not created using Designer) and the "Select Email Client" didn't come up.  I do have Outlook 2007 installed on my home computer, and the Outlook New Mail screen came up with the form attached, the proper "send to" address put in and everything, but since Outlook is not configured, I didn't have a "send" button.

Due to this, I think it would be better to send the email directly to the web server using PHP right?  This way, people who fill out the form will not necessarily need an email client configured, since it will be transmitted via HTTP right?  Am I understanding this correctly?


I reinstalled PHP 5.2.5 on my webserver using the windows installer, seems to have went well (created the PHP folder under the root of the C drive).  I also installed Pear, just in case I needed it.  

BTW, I'm running Windows 2003, with IIS 6.0, and am running Exchange 2003.  My website is stored in this path: "c:\Inetpub\wwwroot\website".

I downloaded PHPMailer, and I don't even understand the installation instructions.  It says:

Copy these files class.phpmailer.php to your web server:
If you are using the SMTP mailer then copy class.smtp.php as well.
If you do not have control of the include directory and you are running PHP 4.0 or higher you can use this function to set it to the path of your files:
ini_set("include_path", ".:/path/to/phpmailer/dir");
Or this:
$mail->PluginDir = "/path/to/phpmailer/dir";

1.  So, where exactly do I copy the "class.phpmailer.php" file to?  Where on the webserver?  And how do I utilize that function to "set it to the path of the files"?

2.  Also, I have found some PHP scripts.  Do I just use Notepad to modify the script as needed, and save it as a PHP file (as in "SubmitPDF.PHP)?  If so, where do I put the file?

3.  Now on to the PDF itself.  I understand I create the "Submit Form" button, but what do I put in for the "URL for this link"?

I think answering these 3 questions will likely get me off to a great starting point for making this happen.  Thank you very much for any assistance you can provide.  :)


Is anyone able to help?  Thanks! :)


IT Manager

Sorry for the delay in responding.  I actually haven't done the set up for PHPMailer and some of the details can depend on your web server so that has been the main reason for the delay.  I have also been very busy. :)

1.  To simplify things put the file (and all other files for this) in the same folder on your web server.  Try the example at http://phpmailer.codeworxtech.com/tutorial.html#2 to see if this works.

Are you on a hosted web server or your own?  Do you know what type of mailing is used by the server (e.g. smtp, etc)?  If you aren't sure then make a php page with the script below and run it.


See what it shows and look for info on sendmail or other mailers.  If your site is hosted it may be easiest to contact them for this info.

You can of course change this and should if you will have lots of pages.  It helps to organize things if they aren't just in one directory.

2.  You can use Notepad.  There are other editors that will make editing PHP files easier.  EditPad Pro, Eclipse IDE, PSPad and Homesite are some programs I use.  PHP files can be saved anywhere on the web server but for the start it may be easier to keep things in one folder (as I mentioned above).  The files need to end with .php though. :)

3.  I am not sure I understand this question.  The form needs to be the type to upload a file and have an input box that used the file type (e.g. <input type="file").  The user will have to specify the PDF file name and location; you can't do this with html or script.  That input does support a "Browse" button though so it isn't hard for them to do this.  Your PHP script that gets the form will need to get the file from the form and save it to the web server before it can be sent as an email attachment.  In fact I don't know that there is a reason to attach the file if you are just sending the email to the same server; it already has the file saved.

I hope this helps.  Let me know if you have a question or how this works.



I'm very sorry for neglecting to finalize this question.  I did end up setting up PHPmailer.  Strugged with it quite a bit to get it working, but it works fine now.  Thank you very much fo your help b0lsc0tt
b0lsc0ttIT Manager

Your welcome!  Thanks for coming back to let me know the status and to close this.  I'm glad I could help.

Thanks for the grade, the points and the fun question.


Explore More ContentExplore courses, solutions, and other research materials related to this topic.