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