Create PHP file:
1. After you finish your html form, create a file Contact.php and post the following code there.PHP code to copy and use:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: me@yoursever.com';
$to = 'yourname@youremail.com';
$subject = 'Request';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
echo '';
} else {
echo '<p>Try again please</p>';
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact form</title>
</head>
<body>
Thank you for your request<br>
I will contact you as soon as possible.
</body>
</html>