I need to send email to gmail with php, i tried the code below with other emails and it works fine, but when i set my gmail account it doesn't work.
<?php
$errors = '';
$myemail = 'example@gmail.com';//<-----email address here.
if(empty($_POST['Email'])  ||
   empty($_POST['Message']));
$theEmail = $_POST['Email']; 
$Message = $_POST['Message'];  
?>
<?php  
$to = $myemail; 
$email_subject = "Contact form submission:"; 
$email_body = "You have received a form submission. ". 
"Here are the details:\nEmail: $theEmail \n". 
"Message: $Message\n"; 
$headers = "From: The Restaurant Website\n"; 
mail($to,$email_subject,$email_body,$headers);
header('Location: index.html'); 
?>
