I can't understand why this simple mailing php function I wrote doesn't work. It's installed inside a Wordpress page (that's why I used REQUEST_URI and not PHP_SELF). I'm just a php beginner, have I forgot something?
<?php
echo '<form method="post" action="';
echo $_SERVER['REQUEST_URI'];
echo '"><input type="image" name="blabla" src="/image-path/image.png"></form>';
if ($_POST['blabla'])
{
$to = 'email@emailadress.com';
$subject = 'Test mail';
$message = 'Test.';
mail($to,$subject,$message);
echo "Email sent.";
}
?>