Topic: easy upload along with attachment mailer script (Read 818 times)
Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: May 16, 2006, 08:13:33 PM »
I downloaded your easy upload and attachment mailer scripts. I got the multi upload example to work with no alterations except assigning the path and extensions to allow.
then I made a duplicate and I tried to use the upload and mail example but couldn\'t get it to work with multiple uploads. there was no example for multi uploads and attachments.
I added these lines of code to the upload_multi_files function inside the if statement for move_upload ------------------------------------------ $full_path = $this->file_copy; $my_mail->create_attachment_part($full_path); $my_mail->process_mail(); $my_mail->del_temp_file($full_path);
Fatal error: Call to a member function on a non-object in ............\\multi_file_mailer.php on line 53
thanks for your help
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6487
39754 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: May 16, 2006, 08:52:31 PM »
Hello,
check this code from the example:
Code:
<?php if ($my_upload->upload()) { $full_path = $my_upload->upload_dir.$my_upload->file_copy; $my_mail->create_attachment_part($full_path); $my_mail->process_mail(); $my_upload->del_temp_file($full_path); // the file is not needed anymore }
$full_path is the (single) uploaded file. This path is used in the next ro to build an attachment.
I don't think that easy for you to use the multi file upload for sending more than one attachement.
I think its easier to have the code for the single upload x times. In this case you need to create x objects.