Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

HTML mail sa attachmentom (negde hoce, negde ne)

[es] :: PHP :: Smarty template engine :: HTML mail sa attachmentom (negde hoce, negde ne)

[ Pregleda: 3880 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Vas

Član broj: 27052
Poruke: 47
*.dialup.neobee.net.



Profil

icon HTML mail sa attachmentom (negde hoce, negde ne)02.11.2004. u 22:16 - pre 236 meseci
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";

$chk=@mail($uemail, "Your order form Adler WEB Shop", $mailmessage, $header);
if($chk) $chk=@mail($realaemail, "Order from $uname", $mailmessage, $header);
if(!$chk) echo "<p><b>Greska. Nije poslato!</b>";
 
Odgovor na temu

NetworkAdmin

Član broj: 4445
Poruke: 609
*.ppp-01.sa.lol.ba.



Profil

icon Re: HTML mail sa attachmentom (negde hoce, negde ne)05.11.2004. u 20:57 - pre 236 meseci
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";
 
Odgovor na temu

[es] :: PHP :: Smarty template engine :: HTML mail sa attachmentom (negde hoce, negde ne)

[ Pregleda: 3880 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.