Create PHP file:
1. After you finish your html form, create a file MyForm.php and post the following code there.Code to copy:
<?php$to = "yourname@youremail.com"; //put your email address here
$email_subject = "Form submission";
if ($_SERVER["REQUEST_METHOD"] <> "POST")
$error1=$_POST['error'];
unset ($_POST['error']);
if (isset($_POST['email']) && $_POST['email']<>''){
$from = $_POST['email'];
$subject = $_POST['subject'];
$body="";
$return1=$_POST['return'];
unset ($_POST['return']);
while (list($key,$value) = each($_POST)){
$value = stripslashes($value);
$body.= ucwords($key).": ".$value."\r\n";
}
$header = "";
$header = "From: ". $from ."\r\n"."Reply-To: ". $from ."\r\n";
$header.= "User-agent: SimplytheBest SendForm 1.23\r\n";
$header.= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$header.= "Content-Transfer-Encoding: 8bit\r\n";
mail ($to,$email_subject,$body,$header);
}
?>
<!-- The message below will be visible because it is not a php part anymore -->
<html>
<head>
<title>Thank you</title>
</head>
<body>
<div style="width:400px; margin:50px auto; text-align:center; font-size:20px;">
Thanks, I will respond to you shortly <br>
</div>
</body>
</html>