Attachments as $att) {     unset($params);      $params['content_type'] = $att['contenttype'];     $params['encoding']     = 'base00';     $params['disposition']  = 'attachment';     $params['dfilename']    = $att['filename'];     $params['cid']          = $att['cid'];      if ($att['data'] == '' && $att['filename'] <> '') {      if ($fd = fopen($att['filename'], 'rb')) {       $data = fread($fd, filesize($att['filename']));       fclose($fd);      } else {       $data = '';      }      $mimeMessage->addSubpart($data, $params);     } else {      $mimeMessage->addSubpart($att['data'], $params);     }    }     $output = $mimeMessage->encode();    $mimeHeaders = $output['headers'];      foreach ($mimeHeaders as $k => $v) {     $this->debug("MIME header $k: $v");     if (strtolower($k) == 'content-type') {      // PHP header() seems to strip leading whitespace starting      // the second line, so force everything to one line      $this->mimeContentType = str_replace("\r\n", " ", $v);     }    }      return $output['body'];   }    return parent::getHTTPBody($soapmsg);  }    /**  * gets the HTTP content type for the current response.  *  * Note: getHTTPBody must be called before this.  *  * @return string the HTTP content type for the current response.  * @access private  */  function getHTTPContentType() {   if (count($this->responseAttachments) > 0) {    return $this->mimeContentType;   }   return parent::getHTTPContentType();  }    /**  * gets the HTTP content type charset for the current response.  * returns false for non-text content types.  *  * Note: getHTTPBody must be called before this.  *  * @return string the HTTP content type charset for the current response.  * @access private  */  function getHTTPContentTypeCharset() {   if (count($this->responseAttachments) > 0) {    return false;   }   return parent::getHTTPContentTypeCharset();  }   /**  * processes SOAP message re