You are on page 1of 3

<?

php
@$action=$_POST['action'];
@$from=$_POST['from'];
@$realname=$_POST['realname'];
@$replyto=$_POST['replyto'];
@$subject=$_POST['subject'];
@$message=$_POST['message'];
@$emaillist=$_POST['emaillist'];
@$cclist=$_POST['cclist'];
@$file_name=$_FILES['file']['name'];
@$contenttype=$_POST['contenttype'];
@$file=$_FILES['file']['tmp_name'];
@$amount=$_POST['amount'];

set_time_limit(intval($_POST['timelimit']));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>-----------SmTp mailer By Death Burner--------------</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

<center>PHP Mailer </center>

<?php

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

?>

<form name="form1" method="post" action="" enctype="multipart/form-data"><br />


<table width="142" border="0">
<tr>
<td width="81">Your Email:</td>
<td width="219"><input type="text" name="from" value="<?php print $from; ?>"
size="30" /></td>
<td width="212">Your Name:</td>
<td width="278"><input type="text" name="realname" value="<?php print
$realname; ?>" size="30" /></td>
</tr>
<tr>
<td width="81">Reply-To:</td>
<td width="219"><input type="text" name="replyto" value="<?php print
$replyto; ?>" size="30" /></td>
<td width="212">Attach File:</td>
<td width="278"><input type="file" name="file" size="24" /></td>
</tr>
<tr>
<td width="81">Subject:</td>
<td colspan="3" width="703"><input type="text" name="subject" value="<?php
print $subject; ?>" size="90" /></td>
</tr>
<tr>
<td colspan="3" width="520">Message Box :</td>
<td width="278">Email Target / Email Send To :</td>
</tr>
<tr>
<td colspan="3" width="520">
<textarea name="message" cols="56" rows="10"><?php print $message; ?
></textarea><br/>
<input type="radio" name="contenttype" value="plain" checked="checked" />
Plain
<input type="radio" name="contenttype" value="html" /> HTML
<input type="hidden" name="action" value="send" /><br/>
Number to send: <input type="text" name="amount" value="1" size="10" /><br />

Maximum script execution time(in seconds, 0 for no timelimit)<input


type="text" name="timelimit" value="0" size="10" />
<input type="submit" value="Send eMails" />
</td>
<td width="278">
<textarea name="emaillist" cols="32" rows="10"></textarea>
</td>
<td width="278">
<textarea name="cclist" cols="32" rows="20"></textarea>
</td>
</tr>
</table>
</form>
<?php

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);
$ccmail = split("\n", $cclist);
$cccount = count($ccmail);
if ($file_name)
{
if (!file_exists($file))
{ 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($xx=0; $xx<$amount; $xx++)

{ 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 "Sending mail to $to .......";
flush();
$header = "From: $realname <$from>
Reply-To: $from <$replyto>
";
$header .= "Cc: " . $ccmail[0]." ";
for($y=0; $y<$cccount; $y++)
{
$header .= ", " . $ccmail[$y] ." ";
}
$header .= "\r\n";
$header .= "MIME-Version: 1.0";
If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid
"; If ($file_name) $header .= "--$uid
"; $header .= "Content-Type: text/$contenttype
"; $header .= "Content-Transfer-Encoding: 8bit
"; $header .= "$message
"; If ($file_name) $header .= "--$uid
"; If ($file_name) $header .= "Content-Type: $file_type; name=\"$file_name\"
"; If ($file_name) $header .= "Content-Transfer-Encoding: base64
"; If ($file_name) $header .= "Content-Disposition: attachment;
filename=\"$file_name\"
"; If ($file_name) $header .= "$content
"; If ($file_name) $header .= "--$uid--";

mail($to, $subject, "", $header); print "ok Sent<br>"; flush(); } }


}

}
?>

</body>
</html>

You might also like