March 20th, 2013, 10:01 AM
How to create a mailto syntax with attachment on a PDF file?
Hello everyone, this is my first post so please be gentle!
Recently, we've introduced a new procedure at work where we will issue questionnaires to customers so that we can evaluate our performance.
I have created a basic PDF file with check boxes and such, but as questionnaires are usually very mundane and time consuming I want to be able to make this form as quick and simple as possible.
What I want to do is attach a button at the bottom of the questionnaire which will open the user's default email software and attach the completed questionnaire to the message.
So far, I've added a mailto syntax which opens the email software with my email address already inserted in the "Send to" bar. What I can't figure out is how to attach the completed form to that message.
Is this possible through html and if so, please help!
March 20th, 2013, 06:30 PM
It's not possible using standard HTML. You can't control a users computer like that. Imagine if you could... you could upload *any* file like that, and that could lead to some very big security and privacy issues.
If you're doing to do this properly you have two choices. First you can set up a file upload form where users can upload the PDF after they've completed it. It's another step but you can add the link into the form and say "click here to send the form" and users should understand what to do. Second you could ditch the PDF form and do a standard HTML form with the same questions and then either email the answers, save them in a database somewhere or do both.
March 21st, 2013, 11:03 AM
You make a good point. Ok, so I've built up a very basic form using HTML but I'm not sure how to get the details of that completed form onto our systems. So far, I've made a "submit questionnaire" button at the bottom of the page, but how do I link that button to our website or email address?
Originally Posted by Catacaustic
March 21st, 2013, 06:48 PM
For that you need a server-side langauge like PHP, ASP, JSP, or whatever your server runs. You'll pass the values to that and it will send back whatever the forms values are.
If you're using PHP, look up phpmailer as that's about the most widely-used one out there.
March 24th, 2013, 01:41 AM
I think PDF might have a built in feature for submitting forms, although I don't know anything about it. An HTML form is a more flexible way to go.
March 24th, 2013, 06:23 PM
It does. I've seen the designers here try and struggle through it before. It will send values (as long as there's a connection to an email server...) but it doesn't send the complete PDF file. It's also a nightmare to try and set up. it took the lead designer here a day to get it working mostly right. All that for something that I could have thrown together in 30-40 minutes.
Originally Posted by E-Oreo
March 25th, 2013, 03:47 AM
All you need is server-side langauge like PHP, ASP, JSP, or whatever your server runs. If you're using PHP, look up php mailer as many of them have suggested for me.
Comments on this post