Mine
public text v1 · immutable 1 <?php
2 $to = "email@gmail.com";
3 $backto = "skickat.html";
4 if(isset($_POST['mail'])) {
5 $from = $_POST['mail_from'];
6 $subject = "Mail from contact form";
7 $message = "Message from: ".$_POST['mail_from']."\n\n".$_POST['message'];
8 $headers = "From: ".$from;
9 $headers .= "Subject: ".$subject;
10 $headers .= "Reply-To: ".$from;
11 $headers .= "X-Mailer: PHP/".phpversion();
12 mail($to, $subject, $message, $headers);
13 }
14 header("Location: ".$backto);
15 ?>