проблемы с аттачем картинки

Cryptonit

Guest
проблемы с аттачем картинки

При отправте аттачей - картинок вместо них выдаются символы закодированной base64 картинки. (the bat)
PHP:
<?php 
	$xsubject='test';
	$to="[email protected]";
	$fileatt="Demon.jpg";
	$file = fopen($fileatt,'rb');	
	$data = fread($file,filesize($fileatt));
	fclose($file);	
	$data = chunk_split(base64_encode($data));
	$zmes=
	"
	From: x
	Subject: x
	
	MIME-Version: 1.0


	Content-Type: image/jpeg; \n
	name=\"Demon.jpg\";
	Content-Transfer-Encoding: base64 \n\n
	
	".$data;

	
	mail($to,$xsubject,$zmes);
 

Cryptonit

Guest
...думаешь, я не пробовал, к тому же там тоже указывается на этот зендовый пример.

а касательно пиара


<?php
$path2mail="pear/mail/";
include_once($path2mail.'Mail.php');
include_once($path2mail.'mime.php');

$text = 'Text version of email';
$html = '<html><body>HTML version of email<img src="Demon.jpg"></body></html>';
$file = 'Demon.jpg';
$crlf = "\r\n";
$hdrs = array(
'From' => '[email protected]',
'Subject' => 'Test mime message'
);
$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->addHTMLImage ($file, 'image/jpeg');
$mime->setHTMLBody($html);

$body = $mime->get();
$hdrs = $mime->headers($hdrs);
echo"prestep";

$mail =& Mail::factory('mail') or die('fucking pear!!');
//то вот здесь он дохнет и 'step' уже не выводится.

echo"step";

$status =$mail->send('[email protected]', $hdrs, $body);
if (PEAR::isError($status)) {
print("***ERROR");
}

?>
 
Сверху