PHP Mailing Code sending mail to spam/quarantine
<p>The title explains itself. It is a website for in-house employees to buy and sell from each other. Its based solely around Microsoft Outlook emailing addresses. All the emails are supposed to be sent from the seller's email as they post items. Except when I enter <code>&lt;php phpinfo(); ?&gt;</code> on the action php page it tells me that the sendmail_from attribute thing is sending from a bogus email on the server. It seems to be the automatic email for the php script to send from. This may be why the emails are  getting sent to spam, because the email is not valid. Also, I read online about having full and valid headers but most headers seem optional and i cant find anywhere that explains optimal headers. My mailing code: </p>

<pre><code>//send approval email to the approver
    $from = isset($_POST['from'])? $_POST['from']:1;
    $message = isset($_POST['message'])? $_POST['message']:1;
    $message = $message . '&lt;a href="http://dev-corkboard/newapproval.php?id='
        .$result[0][0].'"&gt; Click here to approve website post.&lt;/a&gt;';
// In case any of our lines are larger than 70 characters, we should use
// wordwrap()
    $message = wordwrap($message, 70);
    $to      = 'clehane@eatonvance.com';
    $replyto = isset($_POST['replyto'])? $_POST['replyto']:1;
    $subject = isset($_POST['subject'])? $_POST['subject']:1;
    $headers = "MIME-Version: 1.0" . "\r\n" . 'From: "'.$from.'"' . "\r\n" .
       'Reply-To: "'.$replyto.'"' . "\r\n" .
       'Content-Type:text/html;charset=iso-8859-1' . "\r\n" .
       'X-Mailer: PHP/' . phpversion();
    if (mail($to, $subject, $message, $headers)) {
        //test message for email
    }               
    header ("location: newindex.php");  `
</code></pre>

<p>Any ideas?</p>
