每次加载页面时,PHP脚本都会继续发送电子邮件

I have put together a simple contact form for my website. Using PHP to POST the data and send directly to my email address. But for some reason every time I visit the page on my website. I still get the test message Displaying under the Form. Then when I reload the website and visit the link again it still displays the thank you message. and automatically sends an email. Im still in testing mode 2 days before my launch and I need this figure out. Considering I am novice to php I dont know what goes where.... check out my website to get a live view https://trillumonopoly.com (click "Contact Us" link in menu) I would like for the contact form to disappear and echo the thank you message once sent. And reset after the page is reloaded. I am also using Jquery ajax to load all my pages into a div container. So I would like to keep the content inside that div without forwarding to the Echo message page, leaving my index page

Heres My ajax code

$(document).ready(function () {
    loadMainContent('main');

    $('body').delegate('.navMenu', 'click', function (event) {
        event.preventDefault();
        loadMainContent($(this).attr('href'));
    });
});

function loadMainContent(page) {
    $('#main').load('pages/' + page + '.php');
}

here is html for the form:

<div class="general row container-fluid"><br>
    <center><img src="img/divider.png" class="img-fluid"></center>
        <div class="col-lg-6 col-sm-12">
        <img src="img/logo.png" class="img-fluid" height="540px" width="540px">
        </div>
        <div class="col-lg-6 col-sm-12 container"><center>
            <br><h1 class="form-title">Contact Us</h1><br></center>
            <div class="container"> 
                <form action="pages/mail.php" method="GET" class="box2">
                    NAME:
                    <input type="text" name="name" placeholder="YOUR NAME HERE" required>
                    <br><br>
                    EMAIL:
                    <input type="email" name="email" placeholder="YOUR EMAIL HERE" required>
                    <br><br>
                    MESSAGE:<br>
                    <textarea name="message" rows=10 cols=23 placeholder="YOUR MESSAGE HERE" required></textarea>
                    <br><Br>
                    <button type="submit" value="Message Sent" class="btn btn-danger btn-lg" style="background-color:"red">SUBMIT</button
                </form>
                <center><?php include('mail.php'); ?></center>
           </div>
        </div>

</div>

Here is My simple PHP:

<?php 

$name = $POST['name'];
$email = $POST['email'];
$message = $POST['message'];

mail("info@trillumonopoly.com","ILLUMONOPOLY WEB Contact", $message,"From: $email
");

echo "Thank You For Contacting Us!";




?>

Better than check everything before send mail.

if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])){
    $name = $POST['name'];
    $email = $POST['email'];
    $message = $POST['message'];

    mail("info@trillumonopoly.com","ILLUMONOPOLY WEB Contact", $message,"From: $email
");

    echo "Thank You For Contacting Us!";
}

And send POST request to the index, not mail.php.

<form action="" method="POST">
    ...

So the user can see your message at the end of contact form.