/home2/mshostin/public_html/opco/contact.php
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {

    // Sécurisation des champs
    $email = filter_input(INPUT_POST, "email", FILTER_SANITIZE_EMAIL);
    $message = htmlspecialchars($_POST["message"]);

    // Vérification basique
    if (empty($email) || empty($message)) {
        // Redirection si formulaire incomplet
        header("Location: error.html");
        exit;
    }

    // Adresse de réception
    $to = "ton-adresse@mail.com";   // <-- Mets TON email ici

    // Sujet
    $subject = "Nouveau message depuis le formulaire";

    // Contenu du mail
    $body = "Email : $email\n\n";
    $body .= "Message : \n$message\n";

    // EN-TÊTES (IMPORTANT pour que l'envoi fonctionne)
    $headers = "From:theplug.icloud@gmail.com \r\n";  // <-- IMPORTANT : adresse de ton domaine !
    $headers .= "Reply-To: $email\r\n";
    $headers .= "Content-Type: text/plain; charset=utf-8\r\n";

    // Envoi du message
    if (mail($to, $subject, $body, $headers)) {
        // Redirection SUCCESS
        header("Location: success.html");
        exit;
    } else {
        //  Redirection ERREUR
        header("Location: error.html");
        exit;
    }
}
?>