first commit
This commit is contained in:
1
mail/.htaccess
Normal file
1
mail/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
Options -Indexes
|
26
mail/contact_me.php
Normal file
26
mail/contact_me.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
// Check for empty fields
|
||||
if(empty($_POST['name']) ||
|
||||
empty($_POST['email']) ||
|
||||
empty($_POST['phone']) ||
|
||||
empty($_POST['message']) ||
|
||||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
echo "Completer tous les champs";
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = $_POST['name'];
|
||||
$email_address = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$message = $_POST['message'];
|
||||
|
||||
// Create the email and send the message
|
||||
$to = 'contact@lalis.fr'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
|
||||
$email_subject = "[Site] Contact de: $name";
|
||||
$email_body = "Vous avez recu un message depuis le formulaire du site.\n\n"."Voici les details:\n\nNom: $name\n\nEmail: $email_address\n\nTelephone: $phone\n\nMessage:\n$message";
|
||||
$headers = "From: noreply@lalis.fr\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
|
||||
$headers .= "Reply-To: $email_address";
|
||||
mail($to,$email_subject,$email_body,$headers);
|
||||
return true;
|
||||
?>
|
30
mail/test_mail.html
Normal file
30
mail/test_mail.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<form action="https://mailer.jean-cloud.net/submit" method="POST">
|
||||
<input type="hidden" name="token" value="t4iFZ6oEKAbPYvfT8GXe5aUcCwBVgL0k2IzN1qOJdDm7WyuMrQ" />
|
||||
<!--<input type="hidden" name="token" value="NGWrX0qgyj4DKpx8v3uoThskcIFQ69PLSAUM5fEaOniCbm7wdt" />-->
|
||||
<div>
|
||||
<label for="nom">Votre nom :</label>
|
||||
<input type="text" name="nom" required="required"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="mail">Adresse mail :</label>
|
||||
<input type="email" name="mail" required="required"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tel">Téléphone :</label>
|
||||
<input type="text" name="tel" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="objet">Votre message :</label>
|
||||
<textarea name="message" required="required"></textarea>
|
||||
</div>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user