Есть форма в contact.html
<form class="form-area contact-form text-right" id="myForm" action="mail.php" method="post">
<div class="row">
<div class="col-lg-6 form-group">
<input name="name" placeholder="Enter your name" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter your name'" class="common-input mb-20 form-control" required="" type="text">
<input name="email" placeholder="Enter email address" pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{1,63}$" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter email address'" class="common-input mb-20 form-control" required="" type="email">
<input name="subject" placeholder="Enter subject" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter subject'" class="common-input mb-20 form-control" required="" type="text"> </div>
<div class="col-lg-6 form-group">
<textarea class="common-textarea form-control" name="message" placeholder="Enter Messege" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter Messege'" required=""></textarea>
</div>
<div class="col-lg-12">
<div class="alert-msg" style="text-align: left;"></div>
<button class="genric-btn primary" style="float: right;">Send Message</button>
</div>
</div>
</form>
И сам mail.php
<?php
$to = 'stefurak09@gmail.com';
$name = $_POST["name"];
$email= $_POST["email"];
$text= $_POST["message"];
$subject= $_POST["subject"];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "From: " . $email . "\r\n"; // Sender's E-mail
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message ='<table style="width:100%">
<tr>
<td>'.$name.' '.$subject.'</td>
</tr>
<tr><td>Email: '.$email.'</td></tr>
<tr><td>phone: '.$subject.'</td></tr>
<tr><td>Text: '.$text.'</td></tr>
</table>';
if (@mail($to, $email, $message, $headers))
{
echo 'Your message has been sent.';
}else{
echo 'failed';
}
?>