<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Get form fields
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    
    // Set recipient email address
    $to = "ajayfivedesign@gmail.com"; // Change this to your Gmail address
    
    // Set email subject
    $email_subject = "New Enquiry: $subject";
    
    // Build email content
    $email_body = "You have received a new enquiry.\n\n".
                  "Name: $name\n".
                  "Email: $email\n".
                  "Phone: $phone\n".
                  "Message:\n$message\n";
    
    // Set email headers
    $headers = "From: $email\n";
    $headers .= "Reply-To: $email\n";
    
    // Send email
    if (mail($to, $email_subject, $email_body, $headers)) {
        echo "Thank you! Your enquiry has been sent.";
    } else {
        echo "Oops! Something went wrong and we couldn't send your enquiry.";
    }
}
?>
