AJAX Contact Form

The template comes with simple PHP mail script which allows you to gather leads from your website.

Open 📄 mail.php file (from root of the template) with any text editor and change $recepient variable to your own e-mail address.

<?php

if ( $_POST ) {

  $recepient = 'art.krsk@gmail.com'; // your e-mail
  $sitename  = 'Rubenz Website'; // your site name
  $subject   = "New contact from "$sitename""; // subject template

  $name  = trim( $_POST['visitor_name'] );
  $email = trim( $_POST['visitor_email'] );
  $msg   = trim( $_POST['visitor_msg'] );

  $message = "
  -------------------<br><br>
  Visitor name: $name <br>
  Visitor email: $email <br><br>
  $msg
  <br><br>-------------------
  ";

  mail( $recepient, $subject, $message, "From: $name <$email>" . "rn" . "Reply-To: $email" . "rn" . 'X-Mailer: PHP/' . phpversion() . "rn" . 'Content-type: text/html; charset="utf-8"' );

}

?>

Some other variables and text templates are also safe to customize.

Please note that you need PHP to be enabled on your hosting with mail() allowed function.

If you are experiencing issues with the script, please contact your hosting provider for the assistance and ask if your hosting supports PHP.