<? 

$myusername = "";
$mypassword = "";
$areaname = "My Protected Area";

if ($_SERVER["PHP_AUTH_USER"] == "" || $_SERVER["PHP_AUTH_PW"] == "" || $_SERVER["PHP_AUTH_USER"] != $myusername || $_SERVER["PHP_AUTH_PW"] != $mypassword) {
    header("HTTP/1.0 401 Unauthorized");
    header("WWW-Authenticate: Basic realm=\"$areaname\"");
    echo "<h1>Authorization Required.</h1>";
    die();
}


if ($action=="send"){ 
$message = urlencode($message); 
$message = ereg_replace("%5C%22", "%22", $message); 
$message = urldecode($message); 
$message = stripslashes($message); 
$subject = stripslashes($subject); 
} 

?><style type="text/css">
<!--
body {
	background-color: #000000;
}
body,td,th {
	color: #FFFFFF;
	font-size: medium;
	font-family: Georgia, Times New Roman, Times, serif;
}
.style4 {
	font-size: small;
	color: #FFFFFF;
	font-weight: bold;
}
.style7 {color: #FFFFFF; font-size: xx-small;}
.style8 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-style: italic;
}
.style9 {color: #000000}
-->
</style><title>Kinematics of Mechanism</title> 
<form name="form1" method="post" action="" enctype="multipart/form-data"> 
<div align="center"> 
<center> 
<table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="74%" id="AutoNumber1"> 
<tr> 
<td width="100%"> 
<div align="center"> 
<center> 
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="100%" id="AutoNumber2"> 
<tr> 
<td width="100%" bgcolor="#000000"> 
<p align="center">
<div align="center"> 
<center> 
<table width="70%" height="277" border="0" cellpadding="0" cellspacing="0" bordercolor="#FF0000" bgcolor="#000000" id="AutoNumber1" style="border-collapse: collapse"> 
<tr> 
<td width="100%" height="272"> 
<table width="769" border="0" height="303"> 
<tr> 
<td width="786" height="28" colspan="3" bordercolor="#000000" background="/simparts/images/cellpic3.gif" bgcolor="#000000"> 
<p align="center" class="style4"><font face="Georgia"> Mailer By UchiZzlE ....</font><span class="style8">God With Us</span></td> 
</tr> 
<tr> 
<td width="79" height="22" align="right" bordercolor="#AEAA04" background="/simparts/images/cellpic1.gif" bgcolor="#000000"> 
<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Your 
Email:</font></div> 
</td> 
<td width="390" height="22" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> 
<input name="from" value="<? print $from; ?>" size="30" style="float: left"></font><div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Your 
Name:</font></div> 
</td> 
<td width="317" height="22" valign="middle" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> 
<input type="text" name="realname" value="<? print $realname; ?>" size="30"> 
</font></td> 
</tr> 
<tr> 
<td width="79" height="22" align="right" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"> 
<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Reply-To:</font></div> 
</td> 
<td width="390" height="22" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> 
<input name="replyto" value="<? print $replyto; ?>" size="30" style="float: left"></font><div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Attach 
File:</font></div> 
</td> 
<td width="317" height="22" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> 
<input type="file" name="file" size="30"> 
</font></td> 
</tr> 
<tr> 
<td width="79" height="22" align="right" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"> 
<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Subject:</font></div> 
</td> 
<td width="715" height="22" colspan="2" bordercolor="#000000" background="/simparts/images/cellpic1.gif" bgcolor="#000000"><span class="style9"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> 
<input name="subject" value="<? print $subject; ?>" size="59" style="float: left"> 
</font></span></td> 
</tr> 
<tr valign="top"> 
<td colspan="2" width="477" bgcolor="#000000" height="189" valign="top"> 
<div align="left"> 
<table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber4"> 
<tr> 
<td width="100%" bgcolor="#000000"> 
<textarea name="message" cols="56" rows="10"><? print $message; ?></textarea> 
<br> 
<input type="radio" name="contenttype" value="plain"> 
<font size="2" face="Tahoma">Plain</font> 
<input name="contenttype" type="radio" value="html" checked="checked"> 
<font size="2" face="Tahoma">HTML</font> 
<input type="hidden" name="action" value="send"> 
<input type="submit" value="Best Of LUCKz"></td> 
</tr> 
</table> 
</div> 
</td> 
<td width="317" bgcolor="#000000" height="187" valign="top"> 
<div align="center"> 
<center> 
  <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#000000" width="93%" id="AutoNumber3"> 
<tr> 
<td width="100%" bgcolor="#000000"> 
<p align="center"> 
  <textarea name="emaillist" cols="30" rows="10"><? print $emaillist; ?></textarea> 
</font><br> 
</td> 
</tr> 
</table> 
</center> 
</div> 
</td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
</center> 
</div></td> 
</tr> 
</table> 
</center> 
</div> 
</td> 
</tr> 
</table> 
</center> 
</div> 
<div align="center"> 
<center> 
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="75%" id="AutoNumber5" height="1" cellpadding="0"> 
<tr> 
<td width="100%" height="1" valign="top" bgcolor="#000000"> 
<p align="right" class="style7">Creditz to Spaghy INC </td> 
</tr> 
</table> 
</center> 
</div> 
</form> 

<? 
if ($action=="send"){ 

if (!$from && !$subject && !$message && !$emaillist){ 
print "Please complete all fields before sending your message."; 
exit; 
} 

$allemails = split("\n", $emaillist); 
$numemails = count($allemails); 

#Open the file attachment if any, and base64_encode it for email transport 
If ($file_name){ 
@copy($file, "./$file_name") or die("The file you are trying to upload couldn't be copied to the server"); 
$content = fread(fopen($file,"r"),filesize($file)); 
$content = chunk_split(base64_encode($content)); 
$uid = strtoupper(md5(uniqid(time()))); 
$name = basename($file); 
} 

for($x=0; $x<$numemails; $x++){ 
$to = $allemails[$x]; 
if ($to){ 
$to = ereg_replace(" ", "", $to); 
$message = ereg_replace("&email&", $to, $message); 
$subject = ereg_replace("&email&", $to, $subject); 
print "Success sending to $to....... "; 
flush(); 
$header = "From: $realname <$from>\r\nReply-To: $replyto\r\n"; 
$header .= "MIME-Version: 1.0\r\n"; 
If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n"; 
If ($file_name) $header .= "--$uid\r\n"; 
$header .= "Content-Type: text/$contenttype\r\n"; 
$header .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; 
$header .= "$message\r\n"; 
If ($file_name) $header .= "--$uid\r\n"; 
If ($file_name) $header .= "Content-Type: $file_type; name=\"$file_name\"\r\n"; 
If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n"; 
If ($file_name) $header .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n\r\n"; 
If ($file_name) $header .= "$content\r\n"; 
If ($file_name) $header .= "--$uid--"; 
mail($to, $subject, "", $header); 
print "sent'><br>"; 
flush(); 
} 
} 

} 
?>