<?php
  if(isset($_POST['temat']) && isset($_POST['tresc']) && isset($_POST['do'])){
    $temat = $_POST['temat'];
    $tresc = $_POST['tresc'];
    $do = $_POST['do'];
    if($temat == "" || $tresc == "" || $do == ''){
      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');
  }
?>
