i have an email attachment script that does work and sends me a file with the correct name...however the file is 0 bytes.
here is the php:
$namer = $_FILES["cv_upload"]["name"];
$file ="/home2/deserul7/public_html/nkaccounting/"."temp_cv/"."".$namer."";
$contenttype = $_FILES["cv_upload"]['type'];
$handle = fopen($file, "rb");
$file_size = filesize($file);
$content = fread($handle, $file_size);
fclose($handle);
$content = chunk_split(base64_encode($content));
$uid = md5(uniqid(time()));
$name = basename($file);
$eol = PHP_EOL;
// Basic headers
$header = "From: NK Accounting <sal@desertsunstudio.com>".$eol;
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"";
// Put everything else in $message
$message = "--".$uid.$eol;
$message .= "Content-Type: text/html; charset=ISO-8859-1".$eol;
$message .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$message .= $msg2."<br><br><br>".$eol;
$message .= "--".$uid.$eol;
$message .= "Content-Type: ".$contenttype."; name=\"".$name."\"".$eol;
$message .= "Content-Transfer-Encoding: base64".$eol;
$message .= "Content-Disposition: attachment; filename=\"".$name."\"".$eol;
$message .= $content.$eol;
$message .= "--".$uid."--";
if (@mail($ouremail, $subject2, $message, $header)){
echo "sent";
}
when i send it to my gmail it works fine but when i try to get it thru my mail app in my desktop it comes in at 0 bytes...please help