I'm not aware of any existing code/samples for this, but the individual
components you need to break it down into are pretty straight forward:

1. Learn about forms, validation of user input, and in particular file
uploads (which there is a perfect library of working code in the manual:

2. Then learn about the filesystem functions, in particular, how to read the
contents of the uploaded file into a string, then later about deleting
files, etc etc.

from the manual http://php.net/fread:
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);

3. Then learn a bit about mail() (http://php.net/mail), but really what you
need to do from there is to go over to phpclasses.org, and look at manual
lemos' mime-mail class (unsure of the exact name), which deals with HTML
mail, multi part email, attachments to emails, and everything else you could
possibly need to send an email with an attachment.


on 11/09/02 12:07 AM, Heidi Belal ([EMAIL PROTECTED]) wrote:

> Hi,
> I was wondering if anybody could tell me the best way and how to code sending
> an attachement with an email form.  I want the user to be able to browse and
> select the file he wants to attach, and i want the reciepent to be able to see
> the file that has been attached with the email.
> Thanks,
> Heidi Belal
> Web Developer
> www.code-corner.com
> A bus stops at a bus station;
> a train stops at a train station;
> and on my desk i have a work station ...
> ---------------------------------
> Yahoo! - We Remember
> 9-11: A tribute to the more than 3,000 lives lost

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to