Hi Everyone,
I am trying to create a form where the e-mail generated has a file attached. GrayHead had answered the question and posted the following code:
I can't get it to work. Here's what I'm doing
- Replacing $MyForm with $Campaign01 which is my form's name
- Replacing ->id; with ->2; which is my form's ID
- Replacing 'files/vendorlist.pdf' with 'document/filename.pdf' (not real file name)which is where I placed the file I want to send as attachment (after creating the document folder in the rood directory)
- Dropping the code in the Form Code tab under On Submit code - before sending email:
The form submits OK, but it doesn't contain the attachment. I've also tried a full URL for the file location: 'http://www.mydomain.com/document/filename.pdf' but it doesn't work still.
What am I going wrong?
Jose
EDIT: BTW, I'm on CF V3.1_RC5.5
I am trying to create a form where the e-mail generated has a file attached. GrayHead had answered the question and posted the following code:
<?php
$form_id = $MyForm->formrow->id;
$MyUploads =& CFUploads::getInstance($form_id);
$MyUploads->attachments[] = 'files/vendorlist.pdf';
?>
I can't get it to work. Here's what I'm doing
- Replacing $MyForm with $Campaign01 which is my form's name
- Replacing ->id; with ->2; which is my form's ID
- Replacing 'files/vendorlist.pdf' with 'document/filename.pdf' (not real file name)which is where I placed the file I want to send as attachment (after creating the document folder in the rood directory)
- Dropping the code in the Form Code tab under On Submit code - before sending email:
The form submits OK, but it doesn't contain the attachment. I've also tried a full URL for the file location: 'http://www.mydomain.com/document/filename.pdf' but it doesn't work still.
What am I going wrong?
Jose
EDIT: BTW, I'm on CF V3.1_RC5.5