I have created a form and written a php script to send a mail after clicking the submit button, and display a thank you message after sending the mail. The "Thank you" message is put into another HTML page.
I put those to WWW folder in WAMP server and try it. The "Thank you" page is displayed but the mail is not sent to my mail account.
Why did it not send my mail? Is it necessary to host the web site to do this?
This is the code that I'm using:
<?php
$email_from = 'aa@gmail.com';
$email_subject = "Arrange new Safari service";
$email_body = "You have received a new message from $name.\n"
$to = "aa@gmail.com";
$headers = "From: $email_from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
mail($to,$email_subject,$email_body,$headers);
header('Location: thanking.html');
?>