Forums

attaching pdf file to confirmation email

ecr21 23 Sep, 2009
Hi Guys

Kindly help me out with this.

I created a small form after which the user should recieve a thank you mail and a PDF file from the server shall be attached (in my case it's a brochure).

How do I do it?

I tried the following code in the "after submit before mail":

<?php
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
$MyUploads->attachments[] = 'File Path'; // add complete file path here
?>


Strangely it worked but now it doesnt. And I really have no idea why.

All I need is to attach the brochure to the thank you email the user is getting after he fills in all his data.

Please help me out.
GreyHead 23 Sep, 2009
Hi ER21,

As far as I know that code should work. Are attachments enabled in the Email Setup | Properties?

Bob
GreyHead 23 Sep, 2009
Hi ER21,

For the atachments it needs to be a path not a url.

Bob
ecr21 24 Sep, 2009
Hi Bob

Thanks so much for your support.
I am sorry to pick up so slow but the file path should look like:

'/www/htdocs/w00b9a2d/brochure_2009.pdf' ?

regards,

Joel
This topic is locked and no more replies can be posted.