Contact Form Not Sending :(

Cant seem to get an email through but I cant find any problems… Help much appreciated!

<?php
if (isset($_POST['submit'])){

    //robot catch
    if(!empty($spam)){
        exit;
    }

    //create best new line command depending on OS
    if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
        $eol = "\\r\
";
    } elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
        $eol = "\\r";
    } else {
        $eol = "\
";
    }

    //set variables
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];

    //email recipient
    $artsatheart = "Arts at Heart <email@gmail.com>, ";

    //set subject and message
    $subject = 'Arts at Heart - Email from '.$name.' regarding '.$subject;
    $msg =  'Name: ' .$name. $eol .'Email Address: ' .$email. $eol .'Phone Number: ' .$phone. $eol.'Message: ' .$message. $eol;

    //additional email information for servers
    $headers .= 'From: Arts at Heart <email@gmail.com>' . $eol;
    $headers .= 'Reply-To: ' . $name . ' <' .$email . '>' . $eol;
    $headers .= 'Return-Path: Arts at Heart <email@gmail.com>' . $eol;
    $headers .= "Message-ID:<" . date('M-d-y') . " support@" . $_SERVER['SERVER_NAME'] . ">" . $eol;
    $headers .= "X-Mailer: PHP v" . phpversion() . $eol;

    //mail email
    mail($artsatheart,$subject,$msg,$headers);
    header( 'Location: http://www.facebook.com/' ) ;
    exit();

}else{
    header( 'Location: http://www.cnet.com/' ) ;
    exit();
}
?>
<div id="contactForm">
            <form method="post" action="submit.php">
                <fieldset>
                    <div id="contactLeft">
                        <label for="name">Name</label>
                        <input id="contactInput" type="text" name="name" autofocus="autofocus" placeholder="Full Name" required="required">

                        <label for="email">E-mail</label>
                        <input id="contactInput" type="email" name="email" placeholder="name@domain.com" required="required">

                        <label for="phone">Phone</label>
                        <input id="contactInput" type="tel" name="phone" placeholder="ex. (555) 555-5555">

                        <label for="website">Subject</label>
                        <input id="contactInput" type="text" name="subject" placeholder="What's on your mind?" required="required">
                    </div>

                    <div id="contactRight">
                        <label for="message">Question/Comment</label>
                        <textarea id="message" name="message" placeholder="What's up?" required="required"></textarea>

                        <input id="" type="text" name="spam" placeholder="Spam Catcher">

                        <input id="submitButton" type="submit" name="submit"/>
                    </div>
                </fieldset>
            </form>
        </div>

Try changing this:

$artsatheart = "Arts at Heart <email@gmail.com>, ";

to this:

$artsatheart = "email@gmail.com";

I’m no PHP guy, but I think that should be a pure email address only.

 $artsatheart = "Arts at Heart <email@gmail.com>, ";

Try without the comma

 $artsatheart = "Arts at Heart <email@gmail.com>";

at http://php.net/manual/en/function.mail.php under “to” it says nothing about that comma except if there is another recipient.

Off Topic:

Well spotted, Franz48. And you’ve reminded me to check the PHP manual before ever trying to answer a PHP question. :slight_smile:

Haha apparently it was the server. The code is all good. Agh! and the commas work.