TextBoundary = uniqid(time()); $this->EmailBoundary = uniqid(time()); $this->LineFeed = "\n"; $this->Charset='ISO-8859-1'; $this->TransferEncoding='8bit'; $this->Body = ''; $this->setHeader('Subject', 'Automatically generated message'); $this->HeadersArray=array(); $this->setHeader('Mime-Version', '1.0'); } function setHeader($header, $value){ $this->HeadersArray[$header] = $value; $this->Compiled = false; } function setHeaders($headers){ $headers=str_replace("\r", "", $headers); $headers_lines = explode("\n", $headers); foreach ($headers_lines as $line_num => $line){ list($header_field, $header_value) = explode(':', $line, 2); $header_value = trim($header_value); $this->setHeader($header_field, $header_value); if ($header_field == 'Subject') $this->Subject = $header_value; } } function appendHeader($header, $value){ $this->HeadersArray[$header][] = $value; $this->Compiled = false; } function setFrom($from, $name=''){ $this->From = $from; if ($name!=''){ $from = trim($name).' <'.$from.'>'; } $this->setHeader('From', trim($from)); } function setTo($to, $name=''){ $this->To = $to; if ($name!=''){ $to = trim($name).' <'.$to.'>'; } $this->setHeader('To', trim($to)); } function setSubject($subj){ $this->setHeader('Subject', $subj); } function SetCC($to_cc){ $this->appendHeader('CC', $to_cc); } function SetBCC($to_bcc){ $this->appendHeader('BCC', $to_bcc); } function setReplyTo($reply_to){ $this->setHeader('Reply-to', $reply_to); } function Clear() { $this->Compiled = false; $this->Body = ''; $this->BodyHtml = ''; $this->BodyText = ''; $this->Headers = ''; $this->Files = ''; $this->From = ''; $this->To = ''; } function setTextBody($body_text){ $this->BodyText = $body_text; $this->Compiled = false; } function setHTMLBody($body_html){ $this->BodyHtml = $body_html; $this->IsMultipart = true; $this->Compiled = false; } function compileBody(){ $search = array ( "'(<\/td>.*)[\r\n]+(.*