Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

email attachments


ryanf

Recommended Posts

Hey there. I am creating a page where the user can upload an image, fill out a form then when they hit submit, it will email me with the file attached. I am doing this so they customers can create custom jobs. The only thing I can't figure out is how to attach the file. I know there is a function in includes/classes/email called function add_attachment that will do it but how do i integrate that with function tep_mail in includes/functions/general?

 

Thanks for the help!

Ryan

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

ANyone know this? I am been working on it all day and I can't even get the file to upload :(

 

I am trying this code:

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
   $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$from_email = tep_db_prepare_input($HTTP_POST_VARS['from_email']);
$email_subject = 'Custom Order Enquiry from Website';
   $email_address = '[email protected]';
   $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
   
if (tep_db_prepare_input($HTTP_POST_VARS['custom_image'])) {
  
  $filename = explode('\\\\', $HTTP_POST_VARS['custom_image']);
  $i = 0;
  while ($filename[$i]){
 $i++;
  }
  $image = new upload('custom_image');
     $image->set_destination('/temp/');
     $image->set_filename($filename[$i-1]);
}
if (tep_validate_email($from_email)) {
     tep_mail(STORE_OWNER, $email_address, $email_subject, $enquiry, $name, $from_email, $image, $image->filename, 'application/image');
     tep_redirect(tep_href_link(FILENAME_CUSTOM, 'action=success'));
   } else {
     $error = true;
     $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
   }
 }

 

I am made adjustments to the general.php and email.php as per this thread.

 

Anyone done this before? Whats my deal?

 

Thanks!

Ryan

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Hi Ryan,

I know what you want, but not how. The upload will be after order completion, before, or in the middle? Why don't use a file upload script and get the file in your server?

Do you have a link for this?

thanks

far

Link to comment
Share on other sites

Thanks for the info eric. I read over it yet I don't really know how to use it in my site. I alread thought my page was handling uploads like that. Does anyone know how to get this working?

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Ryan,

Wait 'til this afternoon. I have the files you need, but unfortunally is at home. It is working in my websites.

You can try this demo, but you need to register, don't worry, select fax credit card info as payment and at order confirmation is the link.

http://www.apadirect.com/demo/

I will e-mail you the file tonight.

thanks

far

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...