Click to See Complete Forum and Search --> : Sending images as email attachments via a form?


LDWP
05-23-2005, 03:52 PM
Hello all,

I am having a bit of trouble. I want to allow users to send me an attachment through a form.

The page it is on has a "submit" button at the bottom, which sends the entire page entries to my email address. However, when I recieve this email, all it says is the location of the file on the user's harddrive. It does not attach the picture to the email.

Here is the code I am currently using to try to accompish this:

<form method="POST" action="mailto: (my email address)" enctype="multipart/form-data">
Attachment: <input type="file" name="attachedfile" allow="image/*">

Any help would be greatly appreciated!

ray326
05-23-2005, 11:32 PM
You can't use mailto: for that. You have to parse the multipart data, save the file then build your email from scratch on the server.

LDWP
05-24-2005, 01:28 AM
Thank you very much. Do you by chance happen to know of any websites where I could find some codes on how to do that?

Fang
05-24-2005, 01:35 AM
Advanced email in PHP (http://www.sitepoint.com/article/advanced-email-php)

LDWP
05-24-2005, 06:47 PM
Thanks very very much! :)