Re: email attachment blues
| From: | Jerry | Date: | Tue, 31 Dec 2002 15:58:55 +0000 |
| Subject: | Re: email attachment blues | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17601@lists.php.net to get a copy of this message | ||
I got it working. With the following line: enctype="multipart/form-data" in
the form the $_POST method doesn't work. You have to use the $_FILES method.
I got it to work with the following code:
$userfile = $_FILES['attachment']['tmp_name'];
$filename = $_FILES['attachment']['name'];
copy ($userfile, $filename);
$userfile = $filename;
Thanks for the help,
Jerry
"Manuel Lemos" <mlemos@acm.org> wrote in message
news:20021230162607.40701.qmail@pb1.pair.com...
> Hello,
>
> On 12/30/2002 01:08 PM, Jerry wrote:
> > I'm a newbie trying to create a form that will allow the user send an
> > attachment. I got everything working when I run it from the web server
but
> > not from any other pc. I looked at a lot of examples but I am obviously
> > missing something. It seems like the attachment has to be uploaded to
the
> > server first before sending the attachment.
>
> There may be other problems, but I think the MIME part boundary may not
> be correct.
>
> Anyway, you may want to try this class that lets you compose and send
> complex messages that may include attachments, alternative text and HTML
> parts, embedded images, etc..
>
> http://www.phpclasses.org/mimemessage
>
>
> --
>
> Regards,
> Manuel Lemos
>