Files
zoff/php/mail.php
Kasper Rynning-Tønnesen f9f07e2d6d Added contact-form
2016-02-08 12:41:06 +01:00

18 lines
362 B
PHP

<?php
if(isset($_POST['from']) && isset($_POST['message'])){
$from = htmlspecialchars($_POST['from']);
$message = htmlspecialchars($_POST['message']);
$headers = "From: " . $from . "\r\n";
$result = mail("contact@zoff.no", "Contact from form", $message, $headers);
if($result == FALSE){
echo "failure";
}else{
echo "success";
}
}
?>