<?php
$from = "jghomim@yahoo.com";
$to = "jghomim@yahoo.com";
$subject = "Hello Sendmail.";
$message = "This is an test email to test Sendmail.";
$headers = [ "From: $from" ];
$r = mail( $to, $subject, $message, implode( '\r\n', $headers ) ); 
if(!$r) {
    echo "fail";

}
else 
    echo "succ";