Php mail() function not sending emails.

Hey guys, I am trying to send a mail from php using the mail() function using sendmail but it is not being delivered. Here is the sample code that I am trying.

	$email = $_POST['email'];
	$from_add = "[email protected]"; 

	$to_add = "$email"; //<-- put your yahoo/gmail email address here

	$subject = "Test Subject";
	$message = "Test Message";
	$headers = "From: $from_add \\r\

$headers .= "Reply-To: $from_add \r
$headers .= "Return-Path: $from_add\r
$headers .= "X-Mailer: PHP \r

		$msg = "Mail sent OK";
 	   $msg = "Error sending email!";
	<title>Test form to email</title>

<?php echo $msg ?>
<form action='<?php echo htmlentities($_SERVER['PHP_SELF']); ?>' method='post'>
    <input type="email" name="email">
    <input type="submit" name="submit" value="GO">


In the php configuration file, the sendmail path is set to /usr/sbin/sendmail -t -i. If you guys need any more information, I’ll post it.

Did you check the FAQ first?