Hello friends,
i want to send the mail by using mail function but mail is working and all the data is receiving
,if i attached the file means attaching after sending file name will beas "noname" with 0kb but i can download it please help me
[code=text]<?php
if ($_SERVER['REQUEST_METHOD']=='POST')
{
$strname=ucfirst($_REQUEST["strname"]);
$filename=$_FILES["strresume"]["name"];
$filetype=$_FILES["strresume"]["type"];
$filesize=$_FILES["strresume"]["size"];
$filetemp=$_FILES["strresume"]["tmp_name"];
if($filetype=="application/octet-stream" or $filetype=="text/plain" or $filetype=="application/msword")
{
$message= '
<table cellspacing="0" cellpadding="8" border="0" width="400">
<tr>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
<td style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$strname.'</td>
</tr> </table>';

$subject = "Mail with doc file attachment";
$to="mail2arunprakash14@gmail.com";
//$fp = fopen($strresume, "rb");
// $file = fread($fp, $strresume_size);

// $file = chunk_split(base64_encode($file));

$filename= fopen($filetemp,'rb');
$data=fread($filename,filesize($filetemp));
$data=chunk_split(base64_encode($data));
fclose($filename);
$num = md5(time());
$headers = "From: Name<name@name.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=".$num."\r\n";
$headers .= "--$num\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$headers .= "".$message."\n";
$headers .= "--".$num."\n";
$headers .= "Content-Type:".$strresume_type." ";
$headers .= "name=\"".$strresume_name."\"r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment; ";
$headers .= "filename=\"".$strresume_name."\"\r\n\n";
$headers .= "".$file."\r\n";
$headers .= "--".$num."--";
$dd = mail($to, $subject, $message, $headers);


//fclose($fp);
echo "sent";
}else
{
echo "failed";
}
}
[/code]