Salve, vorrei cortesemente qualcuno che mi corregga questo form che ho creato per mandare una mail con allegato.
il problema è che non ricevo la mail nella mia posta elettronica manuel239@interfree.it.
il file php è ok ma credo che ci sia qualcosa di sbagliato nella pagina html:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
<script language="javascript">
function destinatario_onsubmit()
{


if (document.destinatario.mittente.value=="")
{
window.alert("Devi inserire un formato mail valido per il mittente!!!");
return false;
}

if (document.destinatario.oggetto.value=="")
{
window.alert("Devi inserire l'oggetto della mail!!!");
return false;
}


if (document.destinatario.cantina.value=="")
{
window.alert("Devi inserire il nome della cantina.");
return false;
}


if (document.destinatario.vitigni.value=="")
{
window.alert("Devi inserire il nome della vite.");
return false;
}


if (document.destinatario.gradazione.value=="")
{
window.alert("Devi inserire la gradazione.");
return false;
}


if (document.destinatario.territorio.value=="")
{
window.alert("Devi inserire il nome del territorio.");
return false;
}

if (document.destinatario.esame_visivo.value=="")
{
window.alert("Devi inserire la parte visiva.");
return false;
}

if (document.destinatario.esame_olfattivo.value=="")
{
window.alert("Devi inserire la parte olfattiva.");
return false;
}

if (document.destinatario.esame_gusto_olfattivo.value =="")
{
window.alert("Devi inserire il gusto olfattivo.");
return false;
}




return true;

}

</script>
</head>

<body>
<form action="../formvino.php" method="POST" onSubmit="return destinatario_onsubmit(this)" name="destinatario" enctype="multipart/form-data">
<input type="hidden" name="destinatario" value="manuel239@interfree.it">
<table border="0">
<tr>
<td>Tua Mail</td>
<td><input type="text" name="mittente" value="" /></td>
</tr>
<tr>
<td>Oggetto</td>
<td><input type="text" name="oggetto" value="" /></td>
</tr>
<tr>
<td>Cantina</td>
<td><input type="text" name="cantina" value="" /></td>
</tr>
<tr>
<td>Vitigni</td>
<td><input type="text" id="vitigni" name="vitigni" value="" /></td>
</tr>
<tr>
<td>Gradazione</td>
<td><input type="text" name="gradazione" value="" /></td>
</tr>
<tr>
<td>Territorio</td>
<td><input type="text" name="territorio" value="" /></td>
</tr>
<tr>
<td colspan="2">Esame Visivo</td>
</tr>
<tr>
<td>Note:</td>
<td><textarea cols="20" rows="4" name="esame_visivo"></textarea></td>
</tr>
<tr>
<td colspan="2">Esame Olfattivo</td>
</tr>
<tr>
<td>Note:</td>
<td><textarea cols="20" rows="4" name="esame_olfattivo"></textarea></td>
</tr>
<tr>
<td colspan="2">Esame Gusto Olfattivo</td>
</tr>
<tr>
<td>Note:</td>
<td><textarea cols="20" rows="4" name="esame_gusto_olfattivo"></textarea></td>
</tr>
<tr>
<td>Allega file:</td>
<td><input type="file" name="allegato" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Invia" name="destinatario" /></td>
</tr>
</table>
</form>
</body>
</html>


questo è il file php:

<?php
// Recupero il valore dei campi del form
$destinatario = $_POST['destinatario'];
$mittente = $_POST['mittente'];
$oggetto = $_POST['oggetto'];
$cantina = $_POST['cantina'];
$vitigni = $_POST['vitigni'];
$gradazione = $_POST['gradazione'];
$territorio = $_POST['territorio'];
$esame_visivo = $_POST['esame_visivo'];
$esame_olfattivo = $_POST['esame_olfattivo'];
$esame_gusto_olfattivo = $_POST['esame_gusto_olfattivo'];

// Valorizzo le variabili relative all'allegato
$allegato = $_FILES['allegato']['tmp_name'];
$allegato_type = $_FILES['allegato']['type'];
$allegato_name = $_FILES['allegato']['name'];

// Creo 2 variabili che riempirò più avanti...
$headers = "From: " . $mittente;
$msg = "";

// Verifico se il file è stato caricato correttamente via HTTP
// In caso affermativo proseguo nel lavoro...
if (is_uploaded_file($allegato))
{
// Apro e leggo il file allegato
$file = fopen($allegato,'rb');
$data = fread($file, filesize($allegato));
fclose($file);

// Adatto il file al formato MIME base64 usando base64_encode
$data = chunk_split(base64_encode($data));

// Genero il "separatore"
// Serve per dividere, appunto, le varie parti del messaggio.
// Nel nostro caso separerà la parte testuale dall'allegato
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

// Aggiungo le intestazioni necessarie per l'allegato
$headers .= "\nMIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed;\n";
$headers .= " boundary=\"{$mime_boundary}\"";

// Definisco il tipo di messaggio (MIME/multi-part)
$msg .= "This is a multi-part message in MIME format.\n\n";

// Metto il separatore
$msg .= "--{$mime_boundary}\n";

// Questa è la parte "testuale" del messaggio
$msg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$msg .= "Content-Transfer-Encoding: 7bit\n\n";
$msg .= $cantina . "\n\n";
$msg .= $vitigni . "\n\n";
$msg .= $gradazione . "\n\n";
$msg .= $territorio . "\n\n";
$msg .= $esame_visivo . "\n\n";
$msg .= $esame_olfattivo . "\n\n";
$msg .= $esame_gusto_olfattivo . "\n\n";

// Metto il separatore
$msg .= "--{$mime_boundary}\n";

// Aggiungo l'allegato al messaggio
$msg .= "Content-Disposition: attachment;\n";
$msg .= " filename=\"{$allegato_name}\"\n";
$msg .= "Content-Transfer-Encoding: base64\n\n";
$msg .= $data . "\n\n";

// chiudo con il separatore
$msg .= "--{$mime_boundary}--\n";
}
else
{
$msg = $messaggio;
}

// Invio la mail
if (mail($destinatario, $oggetto, $msg, $headers))
{
echo "

Mail inviata con successo!</p>";
}else{
echo "

Errore!</p>";
}
?>

vi prego di aiutarmi, non so come fare...grazie