okay , ora ti posto il codice dei 2 file. inanzitutto ti ringrazio per la disponibilità che mi offri :-)
parte html :
<form name="form1" method="post" action="mail.php">
<table width="95%" align="center" >
<tr>
<td colspan="2"><div align="center">MODULO CONTATTI </div></td>
</tr>
<tr>
<td width="16%">Nome</td>
<td width="84%"><input type="text" name="nome"></td>
</tr>
<tr>
<td>Cognome</td>
<td><input type="text" name="cognome"></td>
</tr>
<tr>
<td>Città </td>
<td><input type="text" name="citta"></td>
</tr>
<tr>
<td>Indirizzo E-mail </td>
<td><input type="text" name="mail"></td>
</tr>
<tr>
<td>Oggetto</td>
<td><input type="text" name="oggetto"></td>
</tr>
<tr>
<td>Testo</td>
<td><textarea name="testo" cols="40" rows="10"></textarea></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Invia">
</div></td>
</tr>
</table>
</form>
parte php:
<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "indirizzo-dove-vuoi-ricevere-la-mail";
// IL SOGGETTO DELLA MAIL
$subject = "Modulo proveniente dal sito www.sito.it";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body .= "Dati personali ;
nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Città: " . trim(stripslashes($_POST["citta"])) . "\n";
$body .= "Oggetto: " . trim(stripslashes($_POST["oggetto"])) . "\n";
$body .= "testo: " . trim(stripslashes($_POST["testo"])) . "\n";
$body .= "mail: " . trim(stripslashes($_POST["mail"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: Modulo utenti<INDIRIZZO-COME-SOPRA>";
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail è stata inoltrata con successo.";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>
sostituendo i campi non funge restituisce sempre che l'email non può essere inviata . Ho provato tutto ma niente non riesco a capire il perchè

Rispondi quotando