Page 1 of 1

sending files to e-mail along with form in php

Posted: Sat Sep 25, 2004 10:35 am
by breed
Hi
(the usual declaration) I'm a newbie to php,
What I'm after is help for the following. I have a form (php) set up on my website, which works very well, once completed the form send all the info to my e-mail account.

I have been looking for code or examples that will allow the user to upload files (jpgs, gifs, ect). I have seen quite a few coded examples that stores the attched files on the server, but nothing that will send files directly to my e-mail. Can this be done?

I'd be grateful for any help with this

Posted: Sat Sep 25, 2004 10:54 am
by feyd
you just need to change the upload script handler to encode the file for email, and send it.. instead of saving it to the filesystem. If you search for [devnet]+mail +attach*[/devnet] you'll find many threads about attachments and the [php_man]mail[/php_man] function.

First, I'd get the file upload processor working. Then I'd get an email script working. Then I'd adjust that email script to send an attachment. Then I'd join the two into a single set of functions using a common interface, so it's more hot pluggable.