CONTACT ME





Create PHP file:

1. After you finish your html form, create a file MyForm.php and post the following code there.
2. Put your email address here instead of this placeholder: $to = "yourname@youremail.com";
3. Make the respond part with nice design (in the lower html section)
4. You have to upload both, html and php files to the server in order for them to work.

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>