<html>
<head>
<title>
E-Mail sending
</title>
<link rel="stylesheet" href="../dark-yellow.css">

<body id="bd">

<?php
$empfaenger = $_GET["mailto"];
$pwd = "ZENSIERT";
$salt = rand(1, 100000);
$token = hash('ripemd160', $pwd.$salt); 
$mailHash = hash('ripemd160', strtolower(explode("@",$empfaenger)[0])); 

    echo strpos(file_get_contents('../../.hMail.txt'), $mailHash);
    //nicht bereits abgesendet (kein hash match) und eine @mailbox addr.
    $betreff = 'Anfrage Lehrpreis';
$nachricht = "Key   ".$token."\nMail    ".$empfaenger."\nMailhash   ".$mailHash;
$nachricht = wordwrap($nachricht, 70, "\r\n");
$header = 'From: fsr@ifsr.de' . "\r\n" .
    'Reply-To: '.$empfaenger. "\r\n" .
    'X-Mailer: PHP/' . phpversion();

//mail senden
mail("marco.lehner@ifsr.de", $betreff, $nachricht, $header);
//hash speichern
    //Erfolgsmeldung
    echo "<h1>Request sent successfully.</h1><h1>Anfrage erfolgreich versendet.</h1>Wir werden Ihnen eine Mail senden und schreiben ob die Anfrage erfolgreich war.<br>We will send a Mail and write there if the request was successfull.</body></html>";
?>