I can't help with what you say you want to do but have a couple of
suggestions that may change what you want to do.
Why not use a script to generate a page with a time-limited URL on it
that links to the file and let them download the file from that? You
could even give them a choice of file format (text, .zip, .gz,
unix/mac/DOS end-of-line characters (lf/cr/crlf)) to reduce download
time and/or eliminate headaches in converting end-of-line markers.
If you insist on using email, make sure you include a verification step
in the process. Send a one-time email with a random token to the given
email address saying something like:
On Fri, 8 Jul 2005, 12:56:27 -0400 someone, connecting from IP
address 12.34.56.78 and claiming to be you, filled in our form at
http://www.foobar.invalid/cgi-bin/foobar.cgi and requested that the the file, "foobar.txt" (123456 bytes) be
emailled to your address. If this was indeed you, please reply
to this message with the strings "B3ghTmpL" and "OK" added to the
subject to verify this. If it was not you, you may do nothing in
which case, we will not send any file to you or you may reply with
the token "B3ghTmpL" and "BAD" added to the subject, in which case
we will also reject any other subsequent submissions claiming to
be from you.
.... and then handle things as described in that email. Do not include any
advertising copy in the email.
If you don't use some form of verification, especially if the documents
are at all large, your form could be misused by someone for the purpose of
harrassment. An abuser who found your form could fill in the names and
email addresses of those he wanted to harrass and you would get the blame
for sending the large unsolicited files. You could even lose your account
for spamming. (The time-limited download URL would eliminate that
problem.)
--
Windows is *not* a "Toy OS". A screenshot of my desktop (Icons (including
complete alphabet, A to Z) and wallpaper coming soon to a website near (or
far from) you. Toilet-flushing sound available separately on request):
http://www.chebucto.ns.ca/~af380/MyDeskTop-Jun-22-2005.gif