Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> poczta
radex
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 30.10.2003

Ostrzeżenie: (0%)
-----


Problem wyglada nastepujaco. system wysyla e - mail z zalacznikiem ale odbiora dostaje e - mail z nawa zalacznika, moze go sciagnac na dysk ale okazuje sie ze jest pusty, gdzie tkwi problem(w kodzie??). Pozdaje plik sendmail.php , ktory to obsluguje, prosze o pilna pomoc:

sendmail.php:
[php:1:fe371e27ff]<?php

$boundary = "-->===_54654747_===<---->>4255==_";



$head = "From: $fromn";
$head = $head . "X-Mailer: PHPn";
$head = $head . "X-Sender: $fromn";
$head = $head . "MIME-version: 1.0n";
$head = $head . "Content-type: multipart/mixed; ";
$head = $head . "boundary="$boundary"n";
$head = $head . "Content-transfer-encoding: 7BITn";
$head = $head . "X-attachments: $filename_name;nn";



$mesg = "--" . $boundary . "n"; //pamiętamy dwa minusy na początku
$mesg = $mesg . "Content-Type: text/plain; charset="us-ascii"nn";
$mesg = $mesg . $message . "n";
$mesg = $mesg . "--" . $boundary . "n"; //pamiętamy dwa minusy na początku
$mesg = $mesg . "Content-type: " . $filename_type . "; name="$filename_name";n";
$mesg = $mesg . "Content-Transfer-Encoding: base64n";
$mesg = $mesg . "Content-disposition: attachment; filename= "$filename_name"nn";
$mesg = $mesg . fileopenanddecode($filename) . "n"; //czytamy plik i go kodujemy
$mesg = $mesg . "--" . $boundary . "-- n"; //pamiętamy dwa minusy na początku i na końcu



//funkcja odczytująca plik i kodująca go d o formatu base64 zgodnie z RFC 2045
function fileopenanddecode($file) {
if (is_readable($file)) {
$fd = fopen($file, "r");
$plik = fread($fd, filesize($file));
$encoded = chunk_split(base64_encode($plik));
fclose($fd);
}
return $encoded;
}


mail($sendto, $subject, $mesg, $head);

echo 'wiadomość została wysłana';
?>[/php:1:fe371e27ff]
Go to the top of the page
+Quote Post

Posty w temacie
- radex   poczta   31.03.2004, 15:23:31
- - Ozzy   Wklej źródło mail'a, który dostajesz.   31.03.2004, 16:43:51
- - id4   Witam Może spróbuj tutaj: http://forum.php.pl/vie...   31.03.2004, 21:11:59


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 13:02