Witam wszystkich.
Jestem początkujący jeśli chodzi i PHP
Czytałem wiele postów na temat wysyłania maila z załącznikiem, próbowałem na jego podstawie samodzielnie modyfikować skrypt który posiadam, tak by za jego pomocą można było wysyłać więcej niż jeden załącznik... niestety bezskutecznie (IMG:
style_emoticons/default/sadsmiley02.gif)
Byłbym wdzięczny jeśli pomoglibyście mi w edycji tego skryptu, tak by mógł wysyłać wiele załączników, z góry dziękuję
<?php
$arrLocale = array( "pl_PL", "polish_pol" );
$boundary = "-->===_54654747_===<---->>4255==_";
$head = "From: $email\n";
$head = $head . "Reply-To: $email\n";
$head = $head . "X-Mailer: PHP\n";
$head = $head . "X-Sender: $email\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";
$mesg = "--" . $boundary . "\n";
$mesg = $mesg . "Content-Type: text/plain; charset=\"iso-8859-2\"\n\n";
$mesg = $mesg
.$numer = "Numer zlecenia: $numer" ." "
.$data1 = "Data: $data1" ."\n"
.$zleceniodawca = "Zleceniodawca: $zleceniodawca" ."\n"
.$z_jezyka = "Tlumaczenie z jezyka: $z_jezyka" ." "
.$na_jezyk = "na jezyk: $na_jezyk" ."\n"
.$dane = "Dane do rachunku: $dane" ."\n"
.$telefon = "Telefon: $telefon" ."\n"
.$uwagi = "Uwagi: $uwagi" ."\n"
.$www = "Strona www: $www" ."\n"
.$email = "E-MAIL: $email" ."\n"
.$data = "Wysłano dnia: $data" ."\n";
$mesg = $mesg . "--" . $boundary . "\n";
$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";
$mesg = $mesg . "--" . $boundary . "-- \n";
function fileopenanddecode($file) {
}
return $encoded;
}
mail("mojmail@wp.pl", "ZLECENIE ON LINE", $mesg , $head);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta http-equiv="Content-Language" content="pl">
<link rel="Shortcut icon" href="images/ikonka.ico" />
<title>Zlecenie</title>
</head>
<body bgcolor="#9D826D">
<p align="left">
<p></p>
<p></p>
<font face="Arial" style="font-size: 14px" color="#FFFFFF"><b>Dziękuję, Twoje dane zostały przesłane!</b></font>
<p></p>
<button name="B3" onclick="java script:history.back();">Kolejne zlecenie
</button></p>
</body>
</html>
Na podstawie różnych postów na forum domyślam się że trzeba edytować poniższą część, ale niestety nie udało mi się tego zrobić samodzielnie
$mesg = $mesg . "--" . $boundary . "\n";
$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";
$mesg = $mesg . "--" . $boundary . "-- \n";
function fileopenanddecode($file) {
}
return $encoded;
}