Email with attachment from camera

Hi, i just want to send an email with an image captured by camera, for now the working code is to send e-mails only with text fields, but how i can insert also an image in the e-mail?

?php $receiverMail = "mymail@gmail.com"; $name = ltrim(rtrim(strip\_tags(stripslashes($\_POST['name'])))); $email = ltrim(rtrim(strip\_tags(stripslashes($\_POST['email'])))); $place = ltrim(rtrim(strip\_tags(stripslashes($\_POST['place'])))); $subject = ltrim(rtrim(strip\_tags(stripslashes($\_POST['subject'])))); $msg = ltrim(rtrim(strip\_tags($\_POST['msg']))); $ip = getenv("REMOTE\_ADDR"); $msgformat = "Email: $email ($ip)\nSubject: $subject\nPlace: $place\n\nDescription: $msg"; // VALIDATION if(empty($name) || empty($email) || empty($subject) || empty($msg)) { echo "\<h3\>Email not sent \</h3\>\<p\>Try again\</p\>"; } elseif(!ereg("^[\_a-z0-9-]+(\.[\_a-z0-9-]+)\*@[a-z0-9-]+(\.[a-z0-9-]+)\*(\.[a-z]{2,3})$", $email)) { echo "Wrong e-mail adress"; } else { mail($receiverMail, $subject, $msgformat, "From: $name \<$email\>"); echo "\<h3\>Email sent!\</h3\>\<p\>thanks for contacting us\</p\>"; } ?\>

local headers = {} headers["Content-Type"] = "application/x-www-form-urlencoded" headers["Accept-Language"] = "it-IT" local body = "name="..var1.."&email="..var2.."&place="..var3.."&subject="..var4.."&msg="..var5 local params = {} params.headers = headers params.body = body network.request( "http://www.mywebsite.it/send.php", "POST", networkListener, params ) ... local onComplete = function( event ) print( "Returned from camera view." ) event.target.alpha = 0 --here's the file end media.capturePhoto( { listener = onComplete } )