Here is an extremely simple way to create a contact form with PHP and the mail() function.
Copy the code above and keep reading..
<?
if ($_POST){
$to = “youremail@gmail.com”;
$subject = “YOUR SUBJECT”;
$email = $_REQUEST["email"];
$name = $_REQUEST["name"];
$message = “Name: “.$name.”\r\n”. “Email: “.$email.”\r\n”. “Message: “.$_REQUEST["message"];
$headers = “From: $email”; mail($to, $subject, $message, $headers);
echo “Thanks for submitting.”;
}
else
{
?>
<html>
<head>
<title>Contact Us</title>
<body>
<table>
<form action=’email.php’ method=’post’>
<tr>
<td>
Your Name:
</td>
<td><input type=’text’ [...]