mail form not sending
<p>I am using a small php script to submit a contact form. </p>

<p>The script is as follows:</p>

<pre><code>        &lt;?php 
        error_reporting(E_ALL ^ E_NOTICE); // hide all basic notices from PHP

        //If the form is submitted
        if(isset($_POST['submitted'])) {

            // require a name from user
            if(trim($_POST['contactName']) === '') {
                $nameError =  'Forgot your name!'; 
                $hasError = true;
            } else {
                $name = trim($_POST['contactName']);
            }

            // need valid email
            if(trim($_POST['email']) === '')  {
                $emailError = 'Forgot to enter in your e-mail address.';
                $hasError = true;
            } else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['email']))) {
                $emailError = 'You entered an invalid email address.';
                $hasError = true;
            } else {
                $email = trim($_POST['email']);
            }

            // upon no failure errors let's email now!
            if(!isset($hasError)) {

                $emailTo = 'info@mydomain.com';
                $subject = 'Submitted message from '.$name;
                $sendCopy = trim($_POST['sendCopy']);
                $body = "Name: $name \n\nEmail: $email";
                $headers = 'From: ' .' &lt;'.$emailTo.'&gt;' . "\r\n" . 'Reply-To: ' . $email;

                mail($emailTo, $subject, $body, $headers);

                // set our boolean completion value to TRUE
                $emailSent = true;
            }
        }
        ?&gt;
</code></pre>

<p>This script works great on one hosting environment and successfully sends / delivers the form while it's actually not sending at all on another (register.com). Are there any issues with my script or does this have anything to do with the hosting environment itself?</p>
