title: Send Attachment in PHP with OpenCart 2.1.1.1
body: <p>Does anyone with knowledge of OpenCart 2.0.1.1 know how I could implement the following addAttachment function found in system/libary/mail.php:</p>
  
  <pre><code>public function addAttachment($filename) {
    $this-&gt;attachments[] = $filename;
  }
  </code></pre>
  
  <p>into catalog/controller/information/contact.php - so that the default contact form can also include an attachment upload feature? I tried this but no dice.</p>
  
  <pre><code>if (($this-&gt;request-&gt;server['REQUEST_METHOD'] == 'POST') &amp;&amp; $this-&gt;validate()) {
    unset($this-&gt;session-&gt;data['captcha']);
  
  $mail = new Mail($this-&gt;config-&gt;get('config_mail'));
  $mail-&gt;setTo($this-&gt;config-&gt;get('config_email'));
  $mail-&gt;setFrom($this-&gt;request-&gt;post['email']);
  $mail-&gt;setSender($this-&gt;request-&gt;post['name']);
  $mail-&gt;setSubject(sprintf($this-&gt;language-&gt;get('email_subject'), $this-&gt;request-&gt;post['name']));
  $mail-&gt;setText(strip_tags($this-&gt;request-&gt;post['enquiry']));
  $mail-&gt;addAttachment($this-&gt;request-&gt;post['file']);
  $mail-&gt;send();
  $this-&gt;response-&gt;redirect($this-&gt;url-&gt;link('information/contact/success'));
  }
  </code></pre>