I have this code
<?php
if(isset($_POST['submit'])) {
$to = "info@bodom.eu";
$subject = "Form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
echo "<div id='messageok'> Ok. <br /><span> Thank you. </span></div>";
mail($to, $subject, $body);
} else {
echo "<div id='messageok'> Error. </div>";
}
?>
and I need to check if the fields in the form are filled and if e-mail address is correct. Yes, I found many tutorials, but I am not very good in PHP and this code works for me. Thank you.
There are many ways to check valid email
http://www.google.com/search?q=valid+email+address+php+preg_match
this one for example