How to add an image to an e-mail?

How do I add image attachment to this email form in php and html?

  • This is the code I have so far. i don't mind about it being unsecure or badly written etc as it's just for a school project. I just want to add a jpeg, jpg, png and gif supported attachment box to it and limit the file size to 150kb (if possible). And also if I need anything important installed on my server for it etc. The code as seen here is working for me Any help would be great! :D <html> <head> <title>email</title> </head> <body> <form name="email" method="post"> <table align="center"> <tr> <td>from</td> <td> <input type="text" name="from" value=""> </td> </tr> <tr> <td></td> <td> <input type="hidden" name="to" value="[email protected]"> </td> </tr> <tr> <td>subject</td> <td><input type="text" size="30" name="subject" /></td> </tr> <tr> <td colspan="2"> <textarea name="body" cols="26" rows="4"> </textarea> </td> </tr> <tr> <td colspan="2"> <input type="submit" value="send" /> </td> </tr> </table> </form> <? function param($Name) { global $HTTP_POST_VARS; if(isset($HTTP_POST_VARS[$Name])) return($HTTP_POST_VARS[$Name]); return(""); } $from = param("from"); $to = param("to"); $subject = param("subject"); $body = param("body"); if($from != "" && $to != "" && $subject != "") { $headers = "From: " . $from . "\n" . "To: " . $to; mail("", $subject, $body, $headers); } ?> </body> </html>

  • Answer:

teaweeda... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.