title: MIME file attachment is not opening
body: <p>My code is</p>
  
  <pre><code>&lt;?php
  
  require_once "Mail.php"; // PEAR Mail package
  require_once ('Mail/mime.php'); // PEAR Mail_Mime packge 
  
   $from = "&lt;meenu.spiralbean@gmail.com&gt;";
   $to = "&lt;meenu.spiralbean@gmail.com&gt;";
   $subject = "Hi!";
  
  
  $host = "ssl://smtp.googlemail.com";
  $port = "465";
  $username = "example@gmail.com";
  $password = "example";
  
  $smtp = Mail::factory('smtp',
     array ('host' =&gt; $host,
     'port' =&gt; $port,
    'auth' =&gt; true,
    'username' =&gt; $username,
    'password' =&gt; $password));
  
  
  $headers = array ('From' =&gt; $from,
    'To' =&gt; $to,
    'Subject' =&gt; $subject);
  
  
   // attachment
   $file = '/var/www/html/formsubmit/TodoList/upload/abc.pdf';
   $crlf = "n";
   $text="Helllooooo";
   $html = "&lt;html&gt; &lt;head&gt; &lt;title&gt;Mail test&lt;/title&gt; &lt;/head&gt;  &lt;body&gt;something&lt;/body&gt;&lt;/html&gt;";
  
  $mime = new Mail_mime($crlf);
  $mime-&gt;setTXTBody($text);
  $mime-&gt;setHTMLBody($html);
  if($mime-&gt;addAttachment($file))
  {
     echo "Success";
  }
  else 
  
  {
      echo "Failed";
  }
  
  
  $body = $mime-&gt;get();
  $headers = $mime-&gt;headers($headers);
  
  
  $mail = $smtp-&gt;send($to, $headers, $body);
  
  
  if (PEAR::isError($mail)) {
     echo("&lt;p&gt;" . $mail-&gt;getMessage() . "&lt;/p&gt;");
   } else {
   echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
  }
  ?&gt;
  </code></pre>
  
  <p>The attachment is unable to open even after downloading it.</p>
  
  <p>Mail is coming in inbox and attachment is also there.But the attachment seems like txt file.but I am actually attaching a pdf file. I used SMTP mail and MIME mail functions.</p>
  
  <p>Pls help me.</p>