First thing you should do is check your php logfiles. If you see an error about mail it may point you in the right direction.
Next try using the following script (and change user@domain.ext to your email address) on the RHEL5 box and make sure that it works. If it does not then you may need to play with your php.ini file to configure it for mail.
<?php
$to = "user@domain.ext";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
// from
$from = "From: $to";
if (mail($to, $subject, $body, $from)){
echo("Message successfully sent!");
}
else{
echo("Message delivery failed...");
}
?>
If that doesn't work and generates another error then unless you know what the error means you should probably check your /etc/php.ini and make sure that you have mail configured. It should look something like:
sendmail_path = /usr/sbin/sendmail
You might not have sendmail installed on your machine, it's been a long time since I have played with RH. Heck you might have postfix or some other mta installed. This is not the end of the world. IIRC there is usually some sort of wrapper program that gets installed with them that mimics the sending mail features of sendmail.
If for some reason /usr/sbin/sendmail doesn't exist you can try running
> whereis sendmail
And it should give you the path to the wrapper. You would use that instead. :)
Note: If the php.ini file isn't in /etc then RH put it some place else. You can create a file in your web tree and put <?php phpinfo() ?> and then browse to the page and it will tell you where the config file is located as well as a ton of configuration information for your php install. Make sure that you delete whatever you name this file after you are done with it.