aaricwon Posted February 26, 2008 Share Posted February 26, 2008 I know you can have a email form that uploads a file but is it possible to have it actually attach it to the email and not upload it? Link to comment https://forums.phpfreaks.com/topic/93114-php-form-is-it-possible-to-actually-attach-a-file/ Share on other sites More sharing options...
rhodesa Posted February 26, 2008 Share Posted February 26, 2008 Sure (kind of). Technically, when you submit a form with a file attached, it is uploaded. There is no changing that, nor need to change that. PHP puts it into a temporary location. For security reasons, you will still want to use the move_uploaded_file() function, but just put it into another temporary file. Then, just follow the many PHP examples for adding an attachment to an email. Finally, after sending it, just remove the file you temporarily had it stored in. For sending emails with attachments, you may want to check out something like http://phpmailer.codeworxtech.com as writing the code for actually attaching a file to an email can get complicated. Link to comment https://forums.phpfreaks.com/topic/93114-php-form-is-it-possible-to-actually-attach-a-file/#findComment-477044 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.