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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.