You may use the below script to test whether mail function via PHP script is working well in the server.
<?php $to = "email@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "firstname.lastname@example.org"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?>