Hi Everyone,

I am new to PHP and my first asignment was to try and send form data from an html page to an email id using a php script. The form reached the email id, however, the contents of the fields do not display. The filed description though shows up. What could be the problem? I have attached the script below. The same script worked on another linux server before. Any help is appreciated here.

Regards,

Saktiyantra.

<?

ini_set("SMTP","11.11.11.11");

//if($AttachDoc_size>0)
// {
// $AttachDoc_data = fread(fopen($AttachDoc, "rb"), filesize($AttachDoc));
// $str = chunk_split(base64_encode($AttachDoc_data));
// $AttachDoc_data = addslashes($AttachDoc_data);
// }

$Body="<table width=100% border=1 cellspacing=5 cellpadding=5 bgcolor=#E4D8F5>
<tr>
<td width=200 align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Category</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$category</font></font></td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Name</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$name</font> </td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Company</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$company</font></td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Address</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$address</font></td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">City</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$city </font></td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">State</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$state</font> </td>
</tr>
<tr>

<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Zip</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$zip</font> </td>
</tr>
<tr>

<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Country</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$country</font></td>
</tr>

<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Mobile</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$mobile</font> </td>
</tr>
<tr>

<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Telephone
</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$telephone</font>
</td>
</tr>
<tr>

<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Fax
</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$Fax</font>
</td>
</tr>
<tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Email</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$email </font></td>
</tr> <tr>
<td align=right><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Your Requirement</font></td>
<td bgcolor=#FFFFFF><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$yourrequirement </font></td>
</tr>
</table>";

$to = "test@yahoo.com";
$too = "test@yahoo.com";
$subject = "Contact: test";
$from = $email;
$headers = "From:$from\n";
$headers .= "Reply-To: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"MIME_BOUNDRY\"\n";
$headers .= "X-Sender: $from\n";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 3\n";
$headers .= "Return-Path: $from\n";
$headers .= "This is a multi-part message in MIME format.\n";

$message = "--MIME_BOUNDRY\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n";
$message .= "\n";
$message .= "\n";
$message .= "--MIME_BOUNDRY\n";

$message = "--MIME_BOUNDRY\n";
$message .= "MIME-Version: 1.0\r\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "\n";
$message .= "$Body\n";
$message .= "\n";

//if($AttachDoc_size >0){
// $message .= "--MIME_BOUNDRY\n";
// $message .= "Content-Type: $AttachDoc_type; name=\"$AttachDoc_name\"\n";
// $message .= "Content-disposition: attachment\n";
// $message .= "Content-Transfer-Encoding: base64\n";
// $message .= "\n";
// $message .= "$str\n";
// $message .= "\n";
//message ends
//}

mail($to, $subject, $message, $headers);
include("AutoResponder.php");

header("location:../htmls/thank_you.htm");
?>