<?php

$myredirect 
"http://www.jumpx.com/tutorials/3/thankyou.html";

$myname "Gumby";
$mymail "null@jumpx.com";

$subject "Attachment sample";

$message "Hey!  Boy, have I got a file for you.

-Gumby"
;

$myfile "gumby.jpg";
$fp fopen($myfile,"r");
$contents fread($fp,filesize($myfile));
fclose($fp);

$myimage base64_encode($contents);

$headers "From: $myname <$mymail>\nReply-To: <$mymail>\nReturn-Path: <$mymail>\nBcc: admin@jumpx.com\nX-Mailer: PHP\n";

$headers .= "MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=\"myboundary\";
Content-Transfer-Encoding: 7bit\n"
;

$headers .= "--myboundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit\n\n"
;

$headers .= $message."\n";

$headers .= "--myboundary
Content-Type: image/jpeg; name=$myfile;
Content-Transfer-Encoding: base64
Content-Disposition: attachment

$myimage
--myboundary--"
;

if (
$email != "") { mail($email,$subject,$body,$headers); }
header("Location:$myredirect"); die();

?>