codice:
<?php
$email = "tua mail";
$subject = "oggetto mail";
$nome = $_POST["nome"];
$commento = $_POST["commento"];
if (trim($nome != "" && $commento != "")) {
mail(
"$email",
"$subject",
"Nome Cognome: $nome\n
Commento: $commento\n",
"From: $nome <$mail>\nX-Mailer: formail\nContent-Type: text");
print "<center>Il tuo messaggio è stato inviato correttamente, grazie.</center>";
}
else {
print "<center>Tutti i campi sono richiesti
[b] <a href=javascript:history.go(-1)>Torna indietro e riempi ciò che manca!</a></center>";
}
?>
Il codice sopra lo salvi in un file php che dovrai richiamare dal file html
codice:
<FORM action=formail.php method=post>
ciao