I'm trying to send and email using the php function mail(). I understood that if the function's return true it does not necessarily means the mail has been sent.
I installed the phpmail package and the libphp-phpmailer package but still nothing...
This is the code:
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    Name: <input type="text" name="name"/>
    Mail: <input type="text" name="mail"/>
    <input type="submit" value="Send"/>
</form>
<?php
ini_set('display_errors', 1);
error_reporting(~0);
if (isset($_POST["mail"]) && isset($_POST["name"])) {
    $to_mail = $_POST["mail"];
    $to_name = ucfirst($_POST["name"]);
    $subject = "Sent using php";
    $message = "Hi " . $to_name . ", we're glad you could join us. Hope you like our page and that you're studing a lot! Good luck with whatever you're doing! :D";
    $from = "email@gmail.com";
    if(mail($to_mail, $subject, $message, $from)) {
        echo "E-Mail Sent to " . $to_mail;
    } else {
        echo "Could not send E-Mail";
    }
}
?>
