title: Zip file Attachment in mail Issue
body: <p>I am trying to send mail with zip attachment (containing CSV file) using phpMailer. </p>
  
  <p>But when i execute I’m getting zip file in specified location and in mail but in both I can’t extract the CSV file it says CRC failed, file is corrupted. </p>
  
  <p>Can anyone tell me the solution?</p>
  
  <pre><code>&lt;?php
  
  $zip = new ZipArchive();
  $now = new DateTime();
  
  $info = pathinfo($filename);
  $name = $info['filename'];
  $ext = $info['extension'];
  
  $time = "download.zip";
  $pathto = "images/importcsv/download.zip";
  $res = $zip-&gt;open($pathto, ZipArchive::CREATE);
  if ($res == true) {
      $zip-&gt;addFile($filename, substr($filename, strrpos($filename, '/') + 1));
  }
  
  $zip-&gt;close();
  
  yii::import('application.extensions.smtpmail.PHPMailer');
  $mail = new PHPMailer();
  $mail-&gt;Host = $dmmodel-&gt;host;
  $mail-&gt;Username = $dmmodel-&gt;username;
  $mail-&gt;Password = $dmmodel-&gt;password;
  $mail-&gt;Mailer = 'smtp';
  $mail-&gt;Port = $dmmodel-&gt;port;
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;SMTPSecure = ($dmmodel-&gt;smtp_enableSSL == 1 ? 'ssl' : ($dmmodel-&gt;smtp_enableSSL == 2 ? 'tls' : ''));
  
  $mail-&gt;From = $dmmodel-&gt;email_from;
  $mail-&gt;FromName = $dmmodel-&gt;name_from;
  
  $mail-&gt;Subject = "Cron Export CSV";
  $mail-&gt;MsgHTML("Cron Export CSV");
  $mail-&gt;AddAddress($dmmodel-&gt;default_TO, "");
  $mail-&gt;AddAttachment("images/importcsv/download.zip", "download.zip");
  if (!$mail-&gt;Send()) {
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  }
  </code></pre>