I am wondering why this mail function will not execute when it's inside my funtion which I call when the user submits the form
function checkSpam() {
if (strpos($_POST['strasse'], 'spamexample') !== false) {
mail($tofake,$subject,$body,$headers);
echo "fake";
}
else {
mail($to,$subject,$body,$headers);
echo "real";
}
}
if (isset($_POST["senden"])) {
checkSpam ();
}
?>