PHP mail() attachment filename is shown as "untitle"
<p>I am trying to send email with attachment using PHP mail() function. The email gets delivered but in web mail filename appears as "untitle". With Outlook Avast heuristic blocks email completely. </p>

<p>Please  guide me to overcome this issue.</p>

<p>Here is code that I am using</p>

<pre><code> $recieverAdd = 'r@gamil.com';
 $subject = 'Attachment';
 $attDescription="emailing lessons";
 $filename ='example.pdf';
 $file = '/home/user/example.pdf';
 $file_size = filesize($file);
 $handle = fopen($file, "r");
 $content = fread($handle, $file_size);
 fclose($handle);
 $content = chunk_split(base64_encode($content));
 $uid = md5(uniqid(time()));
 $name = basename($file);

 $from_name = $uname;
 $from_mail = 'admin@gmail.com';
 $replyto  ='noreply@gmail.com';
 $header = "From: $from_name";      
 $header .= "\nMIME-Version: 1.0\n" . 
     "Content-Type: multipart/mixed;\n" . 
     " boundary=\"{$uid}\"";

 $message = "&lt;p&gt;&lt;b&gt;Hello &lt;/b&gt;&lt;/p&gt;";
 $messageBody =  "--{$uid}\n" . "Content-Type: text/html; charset=\"iso-8859-1              \"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; 
 $messageBody .= "--{$uid}\n". "Content-Type: application/octet-stream;\n".
        "name=\"{$filename1}\"\n".
        "Content-Description: {$filename}\n" .
        "Content-Disposition: attachment;\n".
        "filename=\"{$filename}\"; size={$file_size};\n" .
        "Content-Transfer-Encoding: base64\n\n". $content."\n\n". "--{$uid}--\n";

 mail($recieverAdd,$subject,$messageBody,$header)
</code></pre>
