You may use the below script to test whether mail function via PHP script is working well in the server.