forse ho risolto:
Codice PHP:
<?php
if(!isset($_POST)) $_POST = $HTTP_POST_VARS;
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
$attach = $_FILES["allegato"]["tmp_name"];
$file_name = $_FILES["allegato"]["name"];
$file_type = $_FILES["allegato"]["type"];
$file_size = $_FILES["allegato"]["size"];
$boundary = md5(uniqid(microtime()));
$file = @fopen($attach, "r");
$contents = @fread($file, $file_size);
$encoded_attach = chunk_split(base64_encode($contents));
@fclose($file);
$headers .= "MIME-version: 1.0\n";
$headers .= "Content-Type: text/html; charset= iso-8859-1\n\n";
$headers .= "X-attachments: $file_name\n";
$dachinome=trim(stripslashes($_POST["nome"]));
$dachiemail="<".trim(stripslashes($_POST["mail"])).">";
$headers .= "From: $dachinome $dachiemail\r\n";
$to ="gr1@slalom.it";
$subject ="Da Kine .: WinShow :.";
$mail_body = "Content-Type: text/plain; charset=us-ascii\n";
$mail_body = "Content-Transfer-Encoding: 7bit\n\n";
$body = "
Dati dell'utente:\n\n
";
$body .= "[b]Ragione Sociale[/b]: " . trim(stripslashes($_POST["rsoc"])) . "
\n";
$body .= "[b]Nome[/b]: " . trim(stripslashes($_POST["nome"])) . "
\n";
$body .= "[b]Cognome[/b]: " . trim(stripslashes($_POST["cognome"])) . "
\n";
$body .= "[b]Via[/b]: " . trim(stripslashes($_POST["via"])) . "
\n";
$body .= "[b]C.A.P.[/b]: " . trim(stripslashes($_POST["cap"])) . "
\n";
$body .= "[b]CIttà[/b]: " . trim(stripslashes($_POST["citta"])) . "
\n";
$body .= "[b]Tel.[/b]: " . trim(stripslashes($_POST["tel"])) . "
\n";
$body .= "[b]E-mail[/b]: " . trim(stripslashes($_POST["mail"])) . "
\n";
$body .= "[b]Nome Agente[/b]: " . trim(stripslashes($_POST["agente"])) . "
\n";
$mail_body = "Content-type: $file_type; name=\"$file_name\"\n";
$mail_body .= "Content-Transfer-Encoding: base64\n";
$mail_body .= "$encoded_attach\n";
if (@mail($to, $subject, $body, $headers))
{
echo "la mail è stata inviata correttamente";
$headers = "Content-Type: text/html; charset= iso-8859-1\n\n";
$headers .= "From: Turbolento.net <info@turbolento.net>\r\n";
mail($_POST["mail"],$subject, $body, $headers);
}
else
{
echo "Si sono verificati dei problemi nell'invio della mail.
";
echo "[url='pop.html']riprova[/url]";
}
?>
ma non mi da l'allegato... come mai???