Proszę o pomoc. Chcę zrobić formularz kontaktowy. Wzorowałam się na tutorialu na youtubie ale nie działa. Próbowałam na localhost i na githubie. Poniżej wklejam kod php i kawałek html.
<?php
$to = 'mojmail@onet.pl';
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$subject = 'Nowy e-mail od ' . $name . ' (' . $email . ')';
$message = $_POST['message'];
$headers = 'From: ' . $name . ' (' . $email . ')';
$headers .= 'Content-Type: text/html; charset=utf-8';
mail($to, $subject, $message, $headers); echo '<h1>Wiadomość wysłana :)</h1>'; ?>
<form method="post" name="contactform" action="mail.php">
<input type="text" name="name" id="name" required="">
<input type="text" name="surname" id="surname" required="">
<input type="text" name="email" id="email" required="">
<input type="text" name="message" id="message" required="">
<input type="submit" name="submit" value="wyślij" class="special">