<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['honeypot'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];

        $to = 'duane.erickson@mtchs.org';
        $subject = 'New Contact Form Submission';
        $body = "Name: $name\nEmail: $email\nMessage: $message";
        $headers = 'From: noreply@thesoulcatsband.com' . "\r\n" .
                   'Reply-To: ' . $email . "\r\n" .
                   'X-Mailer: PHP/' . phpversion();

        if (mail($to, $subject, $body, $headers)) {
            echo "Message sent successfully!";
        } else {
            echo "There was an error sending the message.";
        }
    }
}
?>
