I have another question. I've created a php mail and I want to remove the paper clip attachment since I dont have any attachment to send but when I checked my email it has a paper click attachment. is there a way to remove it? Im using php mail. Thank You
I've comment the attachment part since I'm not using it but it still doesnt work.
Here is my code:
<?php
/* Set e-mail recipient */
$myemail = "test@yahoo.com";
//*** Get values form fields ***//
$contact = $_POST['contact'];
$strtitle = $_POST["txtSubject"];
$type = $_POST['type'];
$message = $_POST['textarea'];
$message = wordwrap($message, 70);
$message = "
<b> Contact No:</b> $contact <br><br>
<b>Description:</b><br>
$message <br><br>
<b>Type</b> : $type
";
//*** Uniqid Session ***//
$strSid = md5(uniqid(time()));
$strHeader = "";
$strHeader .= "MIME-Version: 1.0
";
$strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"
";
$strHeader .= "This is a multi-part message in MIME format.
";
$strHeader .= "--".$strSid."
";
$strHeader .= "Content-type: text/html; charset=utf-8
";
$strHeader .= "Content-Transfer-Encoding: 7bit
";
$strHeader .= $message."
";
//*** Attachment ***//
// if($_FILES["fileAttach"]["name"] != "")
// {
// $strFilesName = $_FILES["fileAttach"]["name"];
// $strFileName = ($_FILES["fileAttach"]["size"] < 1000000);
// $strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"])));
// $strHeader .= "--".$strSid."
";
// $strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"
";
// $strHeader .= "Content-Transfer-Encoding: base64
";
// $strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"
";
// $strHeader .= $strContent."
";
// }
$flgSend = @mail($myemail,$strtitle,null,$strHeader); // @ = No Show Error //
if($flgSend)
{
echo "<script type='text/javascript'>
alert('Report Successfully Sent');window.location.href='Test2.php';
</script>";
// echo "Size: " . ($_FILES["fileAttach"]["size"]);
}
else
//Alert when Cannot connect to server
{
echo "<script type='text/javascript'>
alert('Report Failed to Send : Server Connection Timed Out');window.location.href='Test2.php';
</script>";
// echo "Size Failed: " . ($_FILES["fileAttach"]["size"]);
}
exit();
?>