I am using Ubuntu.I installed sendmail in my local host using the following command

sudo apt-get install sendmail

Now I would like to check whether mail goes from my localhost using following php code.

<?php
$to = "test@test.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?> 

When i execute the code, It takes very long time and finally echo the message as Mail Sent. Is there any possibilities to fix this ?

Edit
Report