Developer Support »

Attach a file to the autoresponse email depending on user input  (See more user questions)

Hi .

You could have one form with a drop-down list on it containing a list of the PDF files, one of which the visitor must select. When they submit the form the chosen PDF file will be attached. Here's how to do it. Put a select input (drop-down) on your form, like this:

<select name="pdf_attachment">
<option value="">Click to select</option>
<option value="file1.pdf">File 1</option>
<option value="file2.pdf">File 2</option>
<option value="file3.pdf">File 3</option>

Then edit the autoresponder attachment code in the script.

Change this:

$autoresponder_attachment_file = ""; this:

$autoresponder_attachment_file = $_REQUEST['pdf_attachment'];

Remember to enable the autoresponder attachment like so:

$autoresponder_attachment = 1;

...and to enter the path to the files on your server, e.g:

$autoresponder_attachment_path = "/home/username/files/";

Remember also to enable the autoresponse:

$autoresponder = 1;

Then the selected file will be attached to the autoresponse.

Some points. Change "file1.pdf" etc to the exact names of the PDF files.
Where "File 1" etc appears in the drop-down is just text, change this to
suit. Equally, change "Click to select" to suit. You can put the drop-down
in the list of required fields if you wish, put in "pdf_attachment" as the filed name.

Best wishes.

Charles Sweeney
The world's easiest feedback script!

----- Original Message -----
Sent: Monday, January 03, 2011 7:16 PM
Subject: Re: FormToEmail-Pro

> Hello again, Charles!
> I have a question on the formtoemail functionality. As we discussed quite
> a while ago, I have a document library of pdfs on my site. Since I'm not a
> web developer AT ALL I was wondering if you could send me the code to have
> the standard form (Name, Email, Comments) pop up in a custom-sized window
> from which the user would enter his info. I'll be using the autoresponder
> feature to then email the requested document back to the user once he
> fills out the form. Since all of the pdfs are on one page I don't want to
> have a visible form for each one, do you know what I mean?
> I just want them to click on a link for the document, enter their details
> in the small popup window, and then have the document emailed to them. Is
> this possible? If I can get this working I will be ecstatic - I absolutely
> love the feature-set and security of your form!
> Thanks.