Here is the PHP email attachment code.
$TO='
ftlaudmedgroup@yahoo.com';
$HEADERS ='From: SRF - Ft. Lauderdale <
ftlaudmedgroup@yahoo.com>'."\r\n";
$RECEP=$_POST['whoto'] ;
$SUBJECT=$_POST['subject'] ;
$MATTER=$_POST['matter'];
$MATTER = nl2br($MATTER);
$MATTER = stripslashes($MATTER);
// Obtain file upload vars
$fileatt = $_FILES['fileatt']['tmp_name'];
$fileatt_type = $_FILES['fileatt']['type']; //"application/octet-stream";
$fileatt_name = $_FILES['fileatt']['name'];
$SIGNATURE= "Some signature";
error_reporting(E_ALL); echo $fileatt."is tmpname".$fileatt_type."is the type and the name is: ".$fileatt_name;
$MATTER.=$SIGNATURE;
$file = fopen($fileatt,'rb');
$data = fread($file,filesize($fileatt));
fclose($file);
//$data = chunk_split(base64_encode($data));
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$HEADERS .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$MATTER . "\n\n";
$data = chunk_split(base64_encode($data));
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
if (mail($TO, $SUBJECT, $email_message, $HEADERS)==TRUE){
.
.
} and so on....