Email from Wamp Works From WordPress But not Page

Howdy! I have a php script that is on a single page. It’s meant to send an email but it doesn’t work. I can send email from a local install of WordPress but not from this page. I am using Wamp and sendmail. If you could help I would appreciate it.

<?php
function spamcheck($field) 
{
    
    //filter_var() sanitizes the e-mail
    //address using FILTER_SANITIZE_EMAIL
    $field = filter_var($field, FILTER_VALIDATE_EMAIL);
    
    //filter_var() validates the e-mail
    //address using FILTER_VALIDATE_EMAIL
    if(filter_var($field, FILTER_VALIDATE_EMAIL)) 
    {
        return TRUE;
    }
    else 
        {
        return False;
    }
}
    //If email form complete, proceed
    if(isset($_REQUEST['email'])) {

    //check validity of email address
    $mailcheck = spamcheck($_REQUEST['email']);
        if($mailcheck == FALSE) {
        echo "Your messed up in the head if you think your going to use that email address!";
    }
    else
    {
        $email = $_POST['email'];
        $subject = $_POST['subject'];
        $message = $_POST['message'];

       $headers  = 'MIME-Version: 1.0' . "\\r\
";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\\r\
";
         mail($email, $subject, $message, $headers);
         echo '$email, $subject, $message, $headers';
    }
    }
     else {
         //if email is not filled out display the form
         echo "<form method='post' action='".$_SERVER['PHP_SELF']."'>
                    <fieldset>
                    <legend>Email</legend>
                    <label for='email'>Email: <input name='email' type='text' /></label><br />
                    <label for='subject' Subject: <input name='subject' type='text' /></label><br />
                    <label for='message'>Message: </label><br />
                    <textarea  name='message' type='text' row='15' cols='40'></textarea><br />
                    <input type='submit' name='submit' />
                    </fieldset>
                </form>";

         }
    

     ?>

Have you tried testing the mail function on your single page?

mail('caffeinated@example.com', 'My Subject', $message);

http://php.net/manual/en/function.mail.php

It worked when I used this from the PHP site (thanks for the link!)

<?php
$to      = 'mine@yahoo.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: me@mine.com' . "\\r\
" .
    'Reply-To: me@mine.com' . "\\r\
" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

I’ll try to incorporate that into my file and see how it works. I may be back. If not thanks for the help!