Acrobat 8 Pro, submit form via email

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!
redmanjbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:
redmanjb,

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.

b0lsc0tt
0
redmanjbAuthor Commented:
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?
0
redmanjbAuthor Commented:
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:
class.phpmailer.php
languages/phpmailer.lang-en.php
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.  :)


0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

redmanjbAuthor Commented:
Is anyone able to help?  Thanks! :)
0
redmanjbAuthor Commented:
anyone?
0
b0lsc0ttIT ManagerCommented:
redmanjb,

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.

phpinfo();

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.

bol
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
redmanjbAuthor Commented:
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
0
b0lsc0ttIT ManagerCommented:
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.

bol
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.