Forum Moderators: coopster
--f95263082ad152438ba3ee2dfe86cf28
Content-Type: application/pdf; name="summary.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="summary.pdf"
Content-Type: multipart/alternative
--f95263082ad152438ba3ee2dfe86cf28
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
if ($this->_attachments) {
$boundary = '=_' . md5(rand() . microtime());
$headers['MIME-Version'] = '1.0';
$headers['Content-Type'] = "multipart/mixed;{$this->CRLF}\tboundary=\"{$boundary}\"";
$hdrs = "--{$boundary}{$this->CRLF}";
$hdrs .= "Content-Transfer-Encoding: 7bit{$this->CRLF}";
$hdrs .= "Content-Type: text/plain; charset=\"ISO-8859-1\"{$this->CRLF}";
$this->message = $hdrs . $this->CRLF . $this->message;
foreach ($this->_attachments as $filename => $file) {
$hdrs = "--{$boundary}{$this->CRLF}";
$hdrs .= "Content-Transfer-Encoding: base64{$this->CRLF}";
$hdrs .= "Content-Type: application/octet-stream;{$this->CRLF}\tname=\"{$filename}\"{$this->CRLF}";
$hdrs .= "Content-Disposition: attachment;{$this->CRLF}\tfilename=\"{$filename}\"{$this->CRLF}";
$this->message .= $hdrs . $this->CRLF . rtrim(chunk_split(base64_encode($file), 76, $this->CRLF)) . $this->CRLF;
}
$this->message .= "--{$boundary}--{$this->CRLF}";
}