<?php
if(isset ($_POST["send"]))
{
$upload_name=$_FILES["upload"]["name"];
$upload_type=$_FILES["upload"]["type"];
$upload_size=$_FILES["upload"]["size"];
$upload_temp=$_FILES["upload"]["tmp_name"];
$message=$_POST["msg"];
$subject = $_POST["subject"];
$to=$_POST["to"];
$from=$_POST["from"];
if($message==""||$subject==""||$to==""||$from=="")
{
echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Please fill all fields</font>';
}
else
{
$fp = fopen($upload_temp, "rb");
$file = fread($fp, $upload_size);
$file = chunk_split(base64_encode($file));
$num = md5(time());
//Normal headers
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=".$num."\r\n";
$headers .= "--$num\r\n";
$headers ="Return-Path: <".clean_msg($from).">\n";
$headers .="From: ".clean_msg($from)." <".clean_msg($youremail).">\n";
$headers .="X-Mailer: PHP/".phpversion()."\n";
$headers .="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
// This two steps to help avoid spam
$headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n";
$headers .= "X-Mailer: PHP v".phpversion()."\r\n";
// With message
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$headers .= "".$message."\n";
$headers .= "--".$num."\n";
// Attachment headers
$headers .= "Content-Type:".$upload_type." ";
$headers .= "name=\"".$upload_name."\"r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n";
$headers .= "Content-Disposition: attachment; ";
$headers .= "filename=\"".$upload_name."\"\r\n\n";
$headers .= "".$file."\r\n";
$headers .= "--".$num."--";
// SEND MAIL
@mail($to, $subject, $message, $headers);
fclose($fp);
echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Mail sent please check inbox and spam both <br /></font>';
}
}
?>
<form id="attach" name="attach" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" enctype="multipart/form-data">
<table>
<tr>
<td>From</td><td>:</td><td><input type="text" name="from" id="from"></td>
</tr>
<tr>
<td>To</td><td>:</td><td><input type="text" name="to" id="to"></td>
</tr>
<tr>
<td>Subject</td><td>:</td><td><input type="text" name="subject" id="subject"></td>
</tr>
<tr>
<td>Message</td><td>:</td><td><input type="text" name="msg" id="msg"></td>
</tr>
<tr>
<td>Attachment<span class="imp">*</span></td><td>:</td><td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" value="Submit" id="send" name="send"></td>
</tr>
</table>
</form>
- Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
- <form id="attach" name="attach" method="post" action="/in/MsotD" enctype="multipart/form-data">
<table>
<tr>
<td>From</td><td>:</td><td><input type="text" name="from" id="from"></td>
</tr>
<tr>
<td>To</td><td>:</td><td><input type="text" name="to" id="to"></td>
</tr>
<tr>
<td>Subject</td><td>:</td><td><input type="text" name="subject" id="subject"></td>
</tr>
<tr>
<td>Message</td><td>:</td><td><input type="text" name="msg" id="msg"></td>
</tr>
<tr>
<td>Attachment<span class="imp">*</span></td><td>:</td><td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" value="Submit" id="send" name="send"></td>
</tr>
</table>
</form>
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
- <form id="attach" name="attach" method="post" action="" enctype="multipart/form-data">
<table>
<tr>
<td>From</td><td>:</td><td><input type="text" name="from" id="from"></td>
</tr>
<tr>
<td>To</td><td>:</td><td><input type="text" name="to" id="to"></td>
</tr>
<tr>
<td>Subject</td><td>:</td><td><input type="text" name="subject" id="subject"></td>
</tr>
<tr>
<td>Message</td><td>:</td><td><input type="text" name="msg" id="msg"></td>
</tr>
<tr>
<td>Attachment<span class="imp">*</span></td><td>:</td><td><input type="file" name="upload" id="upload"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" value="Submit" id="send" name="send"></td>
</tr>
</table>
</form>
preferences:
160.15 ms | 405 KiB | 243 Q