code: public function setAttachment($file = '', $clear = false)
      {
          if (true===$clear) {
              $this->clear('text');
          }
          if (is_array($file)) {
              foreach ($file as $_f) {
                  if (file_exists($_f)) {
                      $this->attachment[] = $_f;
                  }
              }
          } else {
              if (file_exists($file)) {
                  $this->attachment[] = $file;
              }
          }
          return $this;
      }
docs: Set mail file attachment
  
  @param string|array $file The file or files to attach
  @param bool $clear Clear a set content first ? (default is to append a content)
  @return self