<?php
  $do = "moj@adres.email";
  if(isset($_POST['temat']) && isset($_POST['tresc'])){
    $temat = $_POST['temat'];
    $tresc = $_POST['tresc'];
    if($temat == "" || $tresc == ""){
      header('Location:zle_dane.html');
    }
    else{
      if(mail($do, $temat, $tresc)){
        header('Location:dziekuje.html');
      }
      else{
        header('Location:blad_serwera.html');
      }
    }
  }
  else{
    header('Location:zle_dane.html');
  }
?>
