How can i use my email to get the message send by the guest in PHP : <p>I have created a simple contact form, i just want to know how can i use my email inside this code to get the message of the guest directly to my email. Am using this form in laravel.<br>
Here is contact form code:</p>

<pre><code>This is my php code  

&lt;?php

$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
  if (empty($_POST["name"])) {
    $nameErr = "Name is required";
  } else {
    $name = test_input($_POST["name"]);

    if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
      $nameErr = "Only letters and white space allowed"; 
    }
  }

  if (empty($_POST["email"])) {
    $emailErr = "Email is required";
  } else {
    $email = test_input($_POST["email"]);

    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
      $emailErr = "Invalid email format"; 
    }
  }

  if (empty($_POST["website"])) {
    $website = "";
  } else {
    $website = test_input($_POST["website"]);

    if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&amp;@#\/%?=~_|!:,.;]*[-a-z0-9+&amp;@#\/%=~_|]/i",$website)) {
      $websiteErr = "Invalid URL"; 
    }
  }

  if (empty($_POST["comment"])) {
    $comment = "";
  } else {
    $comment = test_input($_POST["comment"]);
  }

  if (empty($_POST["gender"])) {
    $genderErr = "Gender is required";
  } else {
    $gender = test_input($_POST["gender"]);
  }
}

function test_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}
?&gt;
</code></pre>

<p>This is my html code
    &lt;</p>

<pre><code>h2&gt;PHP Form Validation Example&lt;/h2&gt;
    &lt;p&gt;&lt;span class="error"&gt;* required field.&lt;/span&gt;&lt;/p&gt;
    &lt;form method="post" action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;"&gt;  
      Name: &lt;input type="text" name="name" value="&lt;?php echo $name;?&gt;"&gt;
      &lt;span class="error"&gt;* &lt;?php echo $nameErr;?&gt;&lt;/span&gt;
      &lt;br&gt;&lt;br&gt;
      E-mail: &lt;input type="text" name="email" value="&lt;?php echo $email;?&gt;"&gt;
      &lt;span class="error"&gt;* &lt;?php echo $emailErr;?&gt;&lt;/span&gt;
      &lt;br&gt;&lt;br&gt;
      Website: &lt;input type="text" name="website" value="&lt;?php echo $website;?&gt;"&gt;
      &lt;span class="error"&gt;&lt;?php echo $websiteErr;?&gt;&lt;/span&gt;
      &lt;br&gt;&lt;br&gt;
      Comment: &lt;textarea name="comment" rows="5" cols="40"&gt;&lt;?php echo $comment;?&gt;&lt;/textarea&gt;
      &lt;br&gt;&lt;br&gt;
      Gender:
      &lt;input type="radio" name="gender" &lt;?php if (isset($gender) &amp;&amp; $gender=="female") echo "checked";?&gt; value="female"&gt;Female
      &lt;input type="radio" name="gender" &lt;?php if (isset($gender) &amp;&amp; $gender=="male") echo "checked";?&gt; value="male"&gt;Male
      &lt;span class="error"&gt;* &lt;?php echo $genderErr;?&gt;&lt;/span&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;input type="submit" name="submit" value="Submit"&gt;  
    &lt;/form&gt;
</code></pre>

<p>Also i want to know how to print a success message to the guest when they send the message. The success message should be printed below the contact form. </p>
