<?
require_once 'mail_class.php';
$file = fopen('test.pdf','rb');
$data = fread($file,filesize('test.pdf'));
fclose($file);
$data = chunk_split(base64_encode($data));
$headers = array(
'Content-Type: application/pdf; name="Test.pdf"',
'Content-Disposition: attachment; filename="Test.pdf"',
'Content-Transfer-Encoding: base64',
$data
);
if (new Mail('
[email protected]','Test subject','<h2>Mail is send!</h2>', $headers)) {
echo 'Mail is sent -> OK';
}
else {
echo 'Mail is not sent';
}
?>
$this->headers = &$headers; for construct and
for ($i = 0; $i < count($this->headers); $i++) {
$this->sendCommand($this->headers[$i]);
}
for sendHeaders