在Aol电子邮件中发送电子邮件中的pdf附件

I am sending a pdf attachment within an email and am having an issue when trying to be opened in Aol mail. The attachment showing like on email abc.pdf (< 1 KB).The attachment says:

Adobe Reader could not open'abc.pdf' because it is either not a supported file type or because the file has been damaged(for example, it was sent as an email attachement and wasn't correctly decoded).

Here is my code:

include("walljs/mpdf/mpdf.php");
$mpdf=new mPDF();   
$mpdf->ignore_invalid_utf8 = true;
$stylesheet = file_get_contents('appstyle_pdf.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->WriteHTML($output);
$comname = preg_replace("/[^A-Za-z0-9]/","",$_POST['company']); 
$name = $dirname.str_replace(" ","-",$comname)."_".$time_stamp.".pdf";        
$mpdf->Output($name,"F");   

$file = $name;
$crlf = "
";
$filename = basename($file);
$file_size = filesize($file);
$content = chunk_split(base64_encode(file_get_contents($file))); 
$uid = md5(uniqid(time()));
$header = "From: orders@enkapps.com 
"
      ."MIME-Version: 1.0
"
      ."Content-Type: multipart/mixed; boundary=\"".$uid."\"

"
      ."This is a multi-part message in MIME format.
" 
      ."--".$uid."
"
      ."Content-type:text/plain; charset=iso-8859-1
"
      ."Content-Transfer-Encoding: 7bit

"
      .$message." 
      ".$companyinfo."

"
      ."--".$uid."
"
      ."Content-Type: application/octet-stream; name=\"".$filename."\"
"
      ."Content-Transfer-Encoding: base64
"
      ."Content-Disposition: attachment; filename=\"".$filename."\"

"
      .$content."

"
      ."--".$uid."--";

Any Suggestions please.

Try to define your headers in he string $headers like that :

    'Content-Type: application/pdf';
    'Content-Disposition: inline; filename="'.$filename.'"';
        'Cache-Control: private, max-age=0, must-revalidate';
    'Pragma: public';