prepare($sql); $stmt->execute([$name, $email, $message]); $_SESSION['success'] = "Thank you for your message. We will get back to you shortly."; // Optionally send an email notification require_once 'mail/MailService.php'; MailService::sendContactMessage($name, $email, $message, 'vo.info.contact@gmail.com'); } catch (PDOException $e) { // In a real app, you would log this error $_SESSION['error'] = "Sorry, there was an error submitting your message. Please try again later."; } header("Location: /#contact"); exit(); } else { header("Location: /"); exit(); }