<p>I am trying to send an email from a site I am building, but it ends up in the yahoo spam folder. It is the email that sends credentials. What can I do to legitimize it?</p>

<pre><code>$header = "From: site &lt;sales@site.com&gt;\r\n";
$header .= "To: $name &lt;$email&gt;\r\n";
$header .= "Subject: $subject\r\n";
$header .= "Reply-To: site &lt;sales@site.com&gt;" . "\r\n";
$header .= "MIME-VERSION: 1.0\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$phpversion = phpversion();
$header .= "X-Mailer: PHP v$phpversion\r\n";
mail($email,$subject,$body,$header);
</code></pre>

Don't use HTML in your email.
Send it via a legitimate mail server with a static IP and reverse-DNS (PTR) that points to the machine's real host name (and matches a forward lookup).
Include a Message-ID (or ensure that the local mailer adds one for you).
Run your email through
SpamAssassin
and see which bad-scoring rules it matches. Avoid matching them.
Use
DomainKeys Identified Mail
to digitally sign your messages.