I've been doing my first website with basic HTML and CSS and now I want to make a form where someone can enter their name, email and a message that will send to my email adress.
I've been trying to use PHP:
if(isset($_POST['submit'])) {
$name = $_post['name'];
$mailFrom = $_post['mail'];
$message = $_post['message'];
$mailTo = "olaus97@hotmail.com";
$headers = "From: " . $mailFrom;
$txt = "Du har fått mail från ".$name.".\n\n".$message;
mail( $mailTo, $subject, $txt, $headers);
header("Location: index.php?mailsend");
}
My files are named index.html
and send_form_email.php
. My problem is that I can't get it to connect with my HTML document (using Apache for localhost).