[ Vas @ 02.11.2004. 22:16 ] @
Molim da pogledate ovaj kod i kazete mi zasto je na [email protected] i na [email protected] sve u redu, tj. salje html mail i pdf fajl u attachmentu a na [email protected] dobijem kao mail html kod, a umesto attachmenta brdo djubreta u nastavku.


$filename = "./rechnung.pdf";
$handle = fopen($filename, 'rb');
$contents = fread($handle,filesize($filename));
fclose($handle);
$encoded = chunk_split(base64_encode($contents));

$seperator = md5(uniqid(time()));
$from = 'ADLER Export-Import WEB Shop < [email protected] >';
$header = '';
$header .= "From: $from\r\n";
$header .= "MIME-Version: 1.0\r\nContent-Type:"." multipart/mixed;boundary=\"$seperator\";\r\n";
$header .= "charset=\"iso-8859-1\"\r\nContent-Transfer-Encoding:"."7bit\r\n\n";
$header .= "If you are reading this, your mail client does not support MIME.\r\n\n";
$header .= "--$seperator\r\n";
$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n\n";
$header .= $mailmessage."\r\n\n";
$header .= "--$seperator\r\n";
$header .= "Content-Type: application/pdf; name=\"rechnung.pdf\"\r\n";
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment\r\n\n";
$header .= $encoded."\r\n";
$header .= "--$seperator--\r\n";

[email protected]($uemail, "Your order form Adler WEB Shop", $mailmessage, $header);
if($chk) [email protected]($realaemail, "Order from $uname", $mailmessage, $header);
if(!$chk) echo "<p><b>Greska. Nije poslato!</b>";
[ NetworkAdmin @ 05.11.2004. 20:57 ] @
odhovorio sam ti na php:

nemas filename
Code:

$header .= "Content-Type: application/pdf; name=\"rechnung.pdf\"\r\n";
$header .= "Content-Transfer-Encoding: base64\r\n";
$header .= "Content-Disposition: attachment\r\n";
$header .= " filename=\"rechnung.pdf\"\r\n\n";
$header .= $encoded."\r\n";
$header .= "--$seperator--\r\n";