I also tried "files/vendorlist.pdf". Directory files is in my Joomla root.Thanks."> Send attachment to user problem with OnSubmit code - Forums

Forums

Send attachment to user problem with OnSubmit code

jankobler 17 Jan, 2010
Hi all,

I built a simple form where a visitor/user enters his email and then he should receive an email to his inbox with an attachement. I have a problem because users receives the email, but not attachment. I looked over all the previous post and in theory my attachment array should work. But it doesn't. What am I missing in the code bellow?

<?php
$attachments[0] = "/files/vendorlist.pdf";
?>

I also tried "files/vendorlist.pdf". Directory files is in my Joomla root.

Thanks.
GreyHead 17 Jan, 2010
Hi jankobler,

That looks like code for an older version of ChronoForms. Please try
<?php
$form_id = $MyForm->formrow->id;
$MyUploads =& CFUploads::getInstance($form_id);
$MyUploads->attachments[] = 'files/vendorlist.pdf';
?>

Bob
jankobler 17 Jan, 2010
Hallelujah!!!

It works !🙂 Thank you very much!
This topic is locked and no more replies can be posted.