io ho creato questo form, visibile al sito: http://claudioferro.altervista.org/PRENOTA.html
può questo codice inviare tale form:
Codice PHP:
<?php
if(isset($_POST['send']))
{
$destinatario = "destinatario@dominio.ext";
$nome = $_POST['nome'];
$mittente = $_POST['email'];
$testo = $_POST['msg'];
$oggetto = $_POST['oggetto'];
if(mail($destinatario, $oggetto, $testo, "From:".$nome." <".$mittente.">"."\nReply-To:".$nome." <".$mittente.">"))
{
echo "<h3>E-mail inviata con successo;</h3>";
}
else
{
echo "<h3>Errore invio e-mail: <a href=\"".$_SERVER['PHP_SELF']."\" target=\"_self\">riprova</a>;</h3>";
}
}
else
{
echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n";
echo "<h1>Invia e-mail</h1>\n";
echo "<br />Nome<br />\n";
echo "<input type=\"text\" name=\"nome\" size=\"25\" maxlength=\"100\" />\n";
echo "<br />E-mail<br />\n";
echo "<input type=\"text\" name=\"email\" size=\"25\" maxlength=\"100\" />\n";
echo "<br />Oggetto<br />\n";
echo "<input type=\"text\" name=\"oggetto\" size=\"25\" maxlength=\"100\" />\n";
echo "<br />Messaggio<br />\n";
echo "<textarea name=\"msg\" cols=\"25\" rows=\"10\"></textarea>\n";
echo "<br /><br />\n";
echo "<input type=\"submit\" value=\"Invia\" />\n";
echo " \n";
echo "<input type=\"reset\" value=\"Cancella\" />\n";
echo "<input type=\"hidden\" name=\"send\" value=\"1\" />\n";
echo "</form>\n";
}
?>