nie nie przpisałem słowo w słowo
<?
if($tak == "1"){
///
$boundary = "-->===_54654747_===<---->>4255==_";
$sendto ="zundap@vp.pl";
// Zmiennych $subject i $sendto nie musimy w zaden sposób przerabiac.
// Teraz trzeba sformatowac naglówek.
$from = "biuro@nokto.pl.net" ;
$head = "From: $from\n";
$head = $head . "Reply-To: $a_row[title]\n";
$head = $head . "X-Mailer: php\n";
$head = $head . "X-Sender: $from\n";
$head = $head . "MIME-version: 1.0\n";
$head = $head . "Content-type: multipart/mixed; ";
$head = $head . "boundary=\"$boundary\"\n";
$head = $head . "Content-transfer-encoding: 7BIT\n";
$head = $head . "X-attachments: $filename_name;\n\n";
// Jeszcze tylko tresc wiadomosci i mozemy slac poczte
$mesg = "--" . $boundary . "\n"; //pamietamy dwa minusy na poczatku
$mesg = $mesg . "Content-Type: text/plain; charset=\"us-ascii\"\n\n";
$mesg = $mesg . $message . "\n";
$mesg = $mesg . "--" . $boundary . "\n"; //pamietamy dwa minusy na poczatku
$mesg = $mesg . "Content-type: " . $filename_type . "; name=\"$filename_name\";\n";
$mesg = $mesg . "Content-Transfer-Encoding: base64\n";
$mesg = $mesg . "Content-disposition: attachment; filename= \"$filename_name\"\n\n";
$mesg = $mesg . fileopenanddecode($filename) . "\n"; //czytamy plik i go kodujemy
$mesg = $mesg . "--" . $boundary . "-- \n"; //pamietamy dwa minusy na poczatku i na koncu
//funkcja odczytujaca plik i kodujaca go d o formatu base64 zgodnie z RFC 2045
function fileopenanddecode($file) {
}
return $encoded;
}
// i to wszystko teraz tylko
mail($sendto, $subject, $mesg, $head); //i poszlo
///
}else{
?>
<form name="form1" method="post" action="wyslij.php?&tak=1" enctype="multipart/form-data">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr><td>subject</td><td><input type="text" name="subject"></td></tr>
<tr><td>replayto</td><td><input type="text" name="replayto"></td></tr>
<tr><td>from</td><td><input type="text" name="from"></td></tr>
<tr><td>message</td><td><textarea name="message" wrap="VIRTUAL"></textarea></td></tr>
<tr><td>filename</td><td><input type="file" name="filename"></td></tr>
<tr><td colspan="2"><input type="submit" name="Submit" value="Submit"></td></tr>
</table>
</form>
<?
}
?>
Ten post edytował motor 2.02.2006, 18:55:54