HFX Forum

Programming => Web Languages => Topic started by: harsa on December 07, 2009, 04:57:48 AM

Title: how can I send images to an email address with php?
Post by: harsa on December 07, 2009, 04:57:48 AM
hey everybody,

I have a simple form that looks like this:

<form action="mailForm.php" method="post" name="myform" enctype="multipart/form-data">
<input type="hidden" value="some@email.com" name="recipient" />

Image 1:<br />
<input name="userfile" type="file" name="image1" />

Image 2:<br />
<input name="userfile" type="file" name="image2" />

Image 3:<br />
<input name="userfile" type="file" name="image3" />

</form>

what kind of function do I have to write in "mailForm.php" file to make the images send to "some@email.com" ? PLEASE HELP
Title: Re: how can I send images to an email address with php?
Post by: wilnix on January 07, 2010, 02:27:34 PM
The problem you are having is that you have to change the headers in order to prepare to send the image along with the rest of the message. Take a look at this (and 10K other results from google) for example code (no reason recreating the wheel):

http://www.webdeveloper.com/forum/showthread.php?t=189027

wilnix