mail function in Magento

In this article we talk about here when mail not send by Magento store.
So you can check by mail function that is server is working with e-mail.

First off all below code paste in new file like mail.php and upload in root directory.  

Here is code....

 $mageFilename = 'app/Mage.php';
 require_once $mageFilename;
 ini_set('display_errors', 1);

 $to = "";// give your email ID for check mail
 $subject = "This is subject";
 $message = "This is simple text message.";
 $header = "";
 $retval = mail ($to,$subject,$message,$header);
 if( $retval == true )  
   echo "Message sent successfully...";
   echo "Message could not be sent...";
After upload mail.php file run....

and check after your gmail ID. If mail come then not a server problem.