Here is part of the code, which may help:
$_SESSION['contactTF']='closed';
$fields=array();
$fields[]='<table border="0" cellpadding="1" cellspacing="1"><tr><td colspan="2" align="left"></td></tr>';
$fields[]='<tr><td align="center"> </td><td align="left"><strong><u><font color="blue">-Contact Information-</font></u></strong></td></tr>';
$fields[]='<tr><td align="right"><strong>Name:</strong></td><td> ' . $fn.' '.$ln.'</td></tr>';
if($title) {$fields[]='<tr><td align="right"><strong>Title:</strong></td><td> ' . $title.'</td></tr>';}
$fields[]='<tr><td align="right"><strong>Company:</strong></td><td> ' . $co.'</td></tr>';
if($address){$fields[]='<tr><td align="right"><strong>Address:</strong></td><td> ' . $address.'</td></tr>';}
if($city) { $fields[]='<tr><td align="right"><strong>City:</strong></td><td> ' . $city.'</td></tr>';}
if($ct==0 || $ct==232){
$fields[]='<tr><td align="right"><strong>State:</strong></td><td> ' . $sA[$st].'</td></tr>';
}else{
if($prov) { $fields[]='<tr><td align="right"><strong>Province:</strong></td><td> ' . $prov.'</td></tr>';}
}
if($zip) { $fields[]='<tr><td align="right"><strong>Zip:</strong></td><td> ' . $zip.'</td></tr>';}
if($cA[$_SESSION['cntry']]) {$fields[]='<tr><td align="right"><strong>Country:</strong></td><td> ' .$cA[$_SESSION['cntry']].'</td></tr>';}
$fields[]='<tr><td align="right"><strong>Email address:</strong></td><td> ' . $e.'</td></tr>';
$fields[]='<tr><td align="right"><strong>Phone:</strong></td><td> ' . $p.'</td></tr>';
if($fax) { $fields[]='<tr><td align="right"><strong>Fax:</strong></td><td> ' . $fax.'</td></tr>';}
$fields[]='<tr><td align="right"><strong>From Website:</strong></td><td> ' .$site.'</td></tr>';
$fields[]='<tr><td align="right"><strong>Contact:</strong></td><td> ' . $contactPerson.'</td></tr>';
$fields[]='<tr><td align="right"><strong>Current Need:</strong></td><td> ' . $rad.'</td></tr>';
if($req) { $fields[]='<tr><td align="right" valign="top"><strong>Additional Requirements:</strong></td><td> '
.stripslashes($req).'</td></tr>';}
if($prodcd) { $fields[]='<tr><td align="right" valign="top"><strong>Product CD:</strong></td><td> Please mail a Product CD</td></tr>';}
$fields[]='<tr><td align="right"> </td></tr>';
$fields[]='<tr><td align="right"> </td></tr>';
$_SESSION['spamemail']='<div style="font-size:10px; color:#FF0000;">
The email address provided did not pass the DNS check. This is most likely a spam email.<br />
From IP: '.$_SERVER['REMOTE_ADDR'].' Host: '.gethostbyaddr($_SERVER['REMOTE_ADDR']);
if ($nvEmail=='true' || $posSpam > 1){
if($nvEmail=='true') {
$fields[]='<tr><td align="right" valign="top" style="font-size:11px; color:#FF0000;">
<strong>Spam Warning:</strong></td><td>' . $_SESSION['spamemail'].'</td></tr>';
}
if($posSpam > 1) {
$fields[]='<tr><td align="right" valign="top" style="font-size:10px; color:#FF0000;">
<strong>Spam Warning:</strong></td><td style="font-size:11px; color:#FF0000;">Total spam flags detected '.$posSpam.'</td></tr>';
}
}
$fields[]='</table>';
$msg="";
$recipmail = "
[email protected]";
//$recipmail = "
[email protected]";
//$recipmail = "
[email protected]";
$emailmsg = '
<html>
<head>
<title>Contact Form</title>
<link href="contact.css" rel="stylesheet" type="text/css" />
<style>
.BoxBorder {
padding: 3px 3px 3px 3px;
border: 1px solid #C0CFE0;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#000000;}
.emailstyle {
font-size:10px;
color:red;
}
</style>
</head>
<body>
<div class="BoxBorder">
<table>
<tr>
<td>';
for ($j=0; $j<count($fields); $j++) {
$emailmsg .= stripslashes($fields[$j]);
} $emailmsg .= '</td>
</tr>
</table>
</div>
</body>
</html>';
$name= $fn . ' ' . $ln;
$subject = $_POST['formname'];
if($subject=='/index.php') {
$subject="";
$subject='Request from home page';
}else{
$subject = explode('/',$subject);
$subject = $subject[count($subject)-1];
$subject = substr($subject,0,-4);
$subject = str_replace('_',' ',$subject);
$page=$subject;
$subject = strtoupper($subject);
}
$subsite = $_SERVER['SERVER_NAME'];
$subsite = explode('www.',$subsite);
$subsite = $subsite[count($subsite)-1];
$subsite = substr($subsite,0);
$subsite = str_replace('_',' ',$subsite);
$subsite = ucfirst($subsite);
$webproduct = $subject;
$subject = 'Product Info Request-'.$subsite.': '. $subject;
$mailsubj = $subject;
if ($nvEmail=='true' || $posSpam > 0) {
$from='Possible Spam E-mail \('.$email.'\)';
}else{
$from = $e;
$from = urldecode($from);
if (eregi("(\r|\n)", $from)) {
die("Why ?? :(");
}
}