hi friends

i am working with mail functions my code is working on my local host but not in server please let me why taht is not working in server....

Here is my code:
$link = mysql_connect('localhost', 'root', '');
$sql="SELECT password FROM registration WHERE emailid='$eid'";
$message="your password is".$r[0];
if(mail($to,$subject,$message,$header ))
echo("<b style='font-family:Verdana, Arial, Helvetica, sans-serif; color:#0099ff'>Your password has been mailed to your email address:<b><br><center>".$eid."</center>");
echo("<p>Message delivery failed...</p>");