my host is
www.azero.dkit provides formmail script but its a perl script...and i dont want to use that..
heres the html form and php script which am using but dont know wots the problem it doesnt work..
*****************This is my html form************
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" enctype="multipart/form-data" action="upload.php">
<p><input type="text" name="mail" size="20"></p>
<p><input type="file" name="upload" size="20" class="formbox"><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>
**************'THIS IS MY PHP SCRIPT************************
<?PHP
error_reporting(7);
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ClientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ClientIP = $_SERVER['REMOTE_ADDR'];
}
# RegisterGlobals OFF
$FTGmail = $_POST['mail'];
$FTGupload = $_FILES['upload']['name'];
if (get_magic_quotes_gpc) {
$FTGmail = stripslashes($FTGmail);
}
# Redirect user to the error page
if ($validationFailed == true) {
header("Location: error.html");
exit;
}
# Email to Form Owner
$emailTo = '"Salim" <salimbharuchi@gmail.com>';
$emailSubject = "attachment.......from $FTGmail";
$emailSubject = preg_replace('/[\x00-\x1F]/', '', $emailSubject);
$emailFrom = "$FTGmail";
$emailFrom = preg_replace('/[\x00-\x1F]/', '', $emailFrom);
$emailHeader = "From: $emailFrom\n"
. "Reply-To: $emailFrom\n"
. "MIME-Version: 1.0\n"
. "Content-Type: multipart/mixed; boundary=\"FTG_BOUNDRY\"\n"
. "X-Sender: $emailFrom\n"
. "X-Mailer: PHP\n"
. "X-Priority: 3\n"
. "Return-Path: $emailFrom\n"
. "This is a multi-part Content MIME format.\n";
$emailBody = "--FTG_BOUNDRY\n"
. "Content-Type: text/plain; charset=\"ISO-8859-1\"\n"
. "Content-Transfer-Encoding: quoted-printable\n"
. "\n"
. "mail: $FTGmail\n"
. "upload: $FTGupload\n"
. "\n"
. ""
. "\n";
if (file_exists($_FILES['upload']['tmp_name']) === true) {
$fileName = $_FILES['upload']['tmp_name'];
$fileHandle = fopen($fileName, 'r');
$fileAttach = fread($fileHandle, filesize ($fileName));
fclose($fileHandle);
$fileAttach = chunk_split(base64_encode($fileAttach));
$emailBody .= "--FTG_BOUNDRY\n"
. "Content-Type: " . $_FILES['upload']['type'] . "; name=\"" . $_FILES['upload']['name'] . "\"\n"
. "Content-disposition: attachment\n"
. "Content-transfer-encoding: base64\n"
. "\n"
. "$fileAttach\n"
. "\n";
}
$emailBody .= "--FTG_BOUNDRY--\n";
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
# Redirect user to success page
header("Location: success.html");
exit;
# End of PHP script
?>