title: PHPMailer Add attachment could not access file error
body: <p>I am sending emails using PHPmailer in my website. When I am sending emails with attachment after submitting its showing <code>Could not access file:</code>. But I am recieving the attachment in my email and when I check the folder I can see my attachment there. Here is my code for sending email:</p>
  
  <pre><code>include_once("class/class.phpmailer.php");
  
  $fullname = $_REQUEST['fullname'];
  $company = $_REQUEST['company'];
  $phone = $_REQUEST['phone'];
  $cemail = $_REQUEST['cemail'];
  $subject = $_REQUEST['subject'];
  $comments = $_REQUEST['comments'];
  
  if($fullname == "" || $phone == "" || $cemail == "" || $subject == "" ||$company == "" || $comments == "")
  {
      return false;
  }
  else
  {
      $curtime = strtotime(date('Ymdhis'));
  
      if(!empty($_FILES['jcv']['name'])) {
          $jcv_name = $_FILES['jcv']['name'];
          $strFileName = basename($jcv_name);
          $strFileSuffix = substr($strFileName, strrpos($strFileName, ".") + 1);
          $strFileNameNoExt = basename($strFileName, ".{$strFileSuffix}");
  
          $path = "../sysimages/cv/";
          $strImgOrig = "../sysimages/cv/" . "{$strFileNameNoExt}_jcv_{$curtime}.{$strFileSuffix}";
          $dbFileName = "{$strFileNameNoExt}_jcv_{$curtime}.{$strFileSuffix}";
  
          if(move_uploaded_file($_FILES["jcv"]["tmp_name"], $strImgOrig)) {
              $applicantcv = $dbFileName;
          }
      }
  
      //echo $strImgOrig; exit;
      $strTo = $admin_email;
  
      mb_internal_encoding("UTF-8");
  
      $strSubject = mb_encode_mimeheader("كولتيك الإمارات- الاستعلامات العامة");
  
      $strMsg = "&lt;div&gt;&lt;p align='right'&gt;مرحباً،&lt;br /&gt; &lt;br /&gt; تفاصيل استعلام جديد&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;
  
      الاسم الكامل : ".$fullname."&lt;br /&gt;&lt;br /&gt;
      الاستفسار : ".$company."&lt;br /&gt;&lt;br /&gt;
      هاتف : ".$phone."&lt;br /&gt;&lt;br /&gt;
      البريد الإلكتروني : ".$cemail."&lt;br /&gt;&lt;br /&gt;
      الرسالة : ".$comments."&lt;br /&gt;&lt;br /&gt;
  
      &lt;br /&gt;&lt;br /&gt;
      شكرا&lt;br /&gt;كولتيك&lt;/p&gt;&lt;/div&gt;";
  
      $objMail = new PHPMailer();
  
      $objMail-&gt;SMTPDebug = 0;
      //      $objMail-&gt;do_debug = 0;
      $objMail-&gt;Host = 'your_host';                 // Specify main and backup server
      $objMail-&gt;Port = 26;                                    // Set the SMTP port
      $objMail-&gt;SMTPAuth = true;                               // Enable SMTP authentication
      $objMail-&gt;Username = 'username';                // SMTP username
      $objMail-&gt;Password = 'passowrd';                  // SMTP password
      $mail-&gt;SMTPSecure = 'ssl';
  
      // send mail
      $objMail-&gt;From = $cemail;                               //  Message From
      $objMail-&gt;AddAddress($strTo);                           //  Message To
      //$objMail-&gt;AddAddress($strCC);
      $objMail-&gt;Subject = $strSubject;                        //  Message Subject
      $objMail-&gt;Body = $strMsg;                               //  Message Body/Content
      $objMail-&gt;IsHTML(true);                                 //  Message type to HTML.
  
      if(!empty($strImgOrig))
      {
          $objMail-&gt;AddAttachment($strImgOrig);
      }
  
      $objMail-&gt;Send();
      $objMail-&gt;ClearAddresses();
  }
  </code></pre>
  
  <p>I don't know where I am going wrong. Can anyone please help me. Thanks in advance.</p>