generated from Templates_CodeFirst/templateHtmlCss
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
625 B
23 lines
625 B
<?php
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
$name = $_POST["name"];
|
|
$email = $_POST["email"];
|
|
$subject = $_POST["subject"];
|
|
$message = $_POST["message"];
|
|
|
|
$to = "hugo.creneau@etu.uca.fr";
|
|
|
|
$email_subject = "New Contact Form Submission: $subject";
|
|
|
|
$email_body = "You have received a new message from $name ($email):\n\n$message";
|
|
|
|
$headers = "From: $name <$email>\r\n";
|
|
$headers .= "Reply-To: $email\r\n";
|
|
|
|
if (mail($to, $email_subject, $email_body, $headers)) {
|
|
header("Location: index.html");
|
|
exit;
|
|
} else {
|
|
echo "Failed to send the email.";
|
|
}
|
|
} |