root@cpanel [~]# cat test.mail
$to = 'firstname.lastname@example.org';
$subject = 'testing phpmail';
$message = 'hello';
$headers = 'From:yourname' . "\r\n" .
'Reply-To: yourname' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
Now execute the command as below to send mail
root@cpanel [~]# php test.mail
Thats it. Check your inbox. If everything is it, it'll be delivered successfully.