
Originariamente inviata da
rash
ma quel form mi sembra davvero strano che funzioni... Comunque ti posto un esempio trovato su google
codice HTML:
<h2>your title</h2>
<form action="receiving.php" method="post">
name:<br><input type="text" name="name" size="40" /><br><br>
email:<br><input type="text" name="email" size="40" /><br><br>
phone:<br><input type="text" name="phone" size="40"><br><br>
message:<br><textarea name="message" rows="3" cols="31" > </textarea><br><br>
<input type="submit" name="submit" value="submit" />
<br><br>
</form>
Codice PHP:
<?php
$name = $_post['name'];
$email = $_post['email'];
$phone = $_post['phone'];
$message = $_post['message'];
$from_add = "contactform@yourwebsite.com";
$to_add = "yourname@yourwebsite.com";
$subject = "your subject name";
$message = "name:$name \n email: $email \n phone: $phone \n
message: $message";
$headers = "from: $from_add \r\n";
$headers .= "reply-to: $from_add \r\n";
$headers .= "return-path: $from_add\r\n";
$headers .= "x-mailer: Php \r\n";
if(mail($to_add,$subject,$message,$headers))
{
$msg = "mail sent";
}
print "<p> thank you $name for your message,
we will be in contact shortly. <a href=\"index.php\">click here</a>
to continue </p>" ;
?>
buon lavoro