Courtesy of http://www.finalwebsites.com/forums/topic/php-e-mail-attachment-script

span class="st0">"r""From: "" <"">\r\n""Reply-To: ".$replyto."\r\n""MIME-Version: 1.0\r\n""Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n""This is a multi-part message in MIME format.\r\n""–".$uid."\r\n""Content-type:text/plain; charset=iso-8859-1\r\n""Content-Transfer-Encoding: 7bit\r\n\r\n""\r\n\r\n""–".$uid."\r\n""Content-Type: application/octet-stream; name=\"""\"\r\n"; // use different content types here
"Content-Transfer-Encoding: base64\r\n""Content-Disposition: attachment; filename=\"""\"\r\n\r\n""\r\n\r\n""–".$uid."–""""mail send … OK"; // or use booleans here
"mail send … ERROR!";
    }
}