Classic Contact Form
This classic contact form lets visitors send you a message with contact details to establish a connection. Here is a general form markup:
... Contact Formform div Field: Namelabel Your name/label input Field: Emaillabel Your email:/label input Field: Messagelabel Your message:/label textarea /textarea Form Buttonbutton Send Message/button div /div /div span /span /form ...
To make everything work, you should edit the mail.php file and specify your email address in the $mail_to variable.
<?php /** * Author: Shadow Themes * Author URL: http://shadow-themes.com */ if ($_SERVER["REQUEST_METHOD"] == "POST") { # Replace this email with your email address $mail_to = "yourmail@example.com"; ... } ?>
Short Contact Form
The short contact form lets visitors share their email addresses without any additional messaging to let you contact them or use it for a news subscription list. Here, we will look at the basic markup for a better understanding of the form code, but in actual usage in our template, the inner markup may differ depending on a block, like Call to Action or Hero Section.
... Short Contact Formform div Mail Fieldinput Form Buttonbutton span /span /button div /div /div span /span /form ...
The same as in the previous example, you should edit the PHP file called mail-short.php and specify your email address in the $mail_to variable. Also, below the $mail_to, you can write some text for the $message variable to display to you in the received message.
<?php /** * Author: Shadow Themes * Author URL: http://shadow-themes.com */ if ($_SERVER["REQUEST_METHOD"] == "POST") { # Replace this email with your email address $mail_to = "yourmail@example.com"; # Message: You can modify that string with your text. $message = ""; ... } ?>
Please note that this is a straightforward basic contact form. There is no captcha or any serious spam protection. To secure your contact form, you should find third-party solutions. For example, here you can find the information about the reCaptcha by Google https://www.google.com/recaptcha/