Location: PHPKode > scripts > Amailer > amailer/index.php
<?
##################################################################################
# Anonymous Mailer Copyright Termix 2002 - 2003. All rights researved.           #
# Just don't change anything.                                                    #
# and don't take out the copyright even though there is an option to take it out #
# and thats all                                                                  #
# Site: http://termix.ath.cx                                                     #
# Auther: Aaron                                                                  #
# E-Mail: hide@address.com                                               #
#                                                                                #
# File: index.php                                                                #
##################################################################################

#####################################################
#Edit below only if you know what you are doing !!!!#
#####################################################
//require_once "../../oaccess.mod.php

require "confi.php";
include "ver.php";
include "function.php";

if(count($_POST)) @extract($_POST);

#####################
# form construction #
#####################
copyright();
function tellform(){
		global $eweee, $hmm, $realemail, $file_url, $result, $rec, $message, $pmessage, $xmessagee, $notify, $html, $htm, $link_id, $default_dbname, $email, $name, $email1, $year, $name1, $sub, $PHP_SELF, $xmessage, $copyleft, $version;

$htm = "Content-Type: text/html; charset=iso-8859-1\n";
?>

<p align="center"><img border="0" src="./Images/amailerh.gif" width="100%" height="83">
<font size="2" face="Verdana"><br>
<img border="0" src="Images/h1.gif" width="85%" height="1"><br>
&nbsp;</font></b><form method="POST" action="<?=$_SERVER['PHP_SELF'];?>">
          <input type="hidden" name="link" value="<?=$link?>" />
  
          <input type="hidden" name="submitok" value="1" />
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
            <tr>
              <td width="50%" align="left">
              <p align="justify">
<b><font size="2" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Your Fake Name:</font></b></td>
              <td width="50%" align="left">
              <p align="justify">
<b><font size="2" face="Verdana">&nbsp;&nbsp;&nbsp; Another Persons e-mail [ don't put your 
              own ]</font></b></td>
            </tr>
            <tr>
              <td width="50%">
              <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="text" name="name" size="20"></font></td>
              <td width="50%">
              <p align="justify">
<font face="Verdana">&nbsp;&nbsp;
  <input type="text" name="email" size="20"></font></td>
            </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
      </td>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;
</font>
      </td>
    </tr>
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
      <b><font face="Verdana" size="2">Your Friends Name:</font></b></td>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp; <font size="2">
  <b>Your Friends E-mail:</b></font></font></td>
    </tr>
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="name1" size="20"></font></td>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;
  <input type="text" name="email1" size="20"></font></td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
      </td>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;
</font>
      </td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <b><font size="2">Subject:</font></b></font></td>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp; <b><font size="2">Attachments:</font></b></font></td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="50%">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="sub" size="20"></font></td>
      <td width="50%">
      <p align="justify">
&nbsp;&nbsp; <font face="Verdana" size="2"><input type="file" name="file_url" size="20"></font></td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="59">
    <tr>
      <td width="50%" height="16">
      <p align="justify">
<font face="Verdana" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
      </td>
      <td width="50%" height="16">
      <p align="justify">
<font face="Verdana" size="2">&nbsp;&nbsp;
</font>
      </td>
    </tr>
    <tr>
      <td width="50%" valign="top" align="justify" height="15">
      <p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Verdana" size="2">
<b>Your real email address: <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
Leave this blank&nbsp; if you do not <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
want to add the <b>REPLY</b> </font><br>
<font face="Verdana" size="2">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
back message.</font></td>
    </tr>
    <tr>
      <td width="50%" align="justify" height="12">
<font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <input type="text" name="realemail" size="20"></font></td>
    </tr>
    <tr>
      <td width="50%" height="16">
      <p align="justify">
<font face="Verdana" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
      </td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="50%" align="justify">
      <p align="justify"><b><font size="2" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      HTML/PLANE:</font></b><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
        <tr>
          <td width="100%" align="justify">
          <p align="justify">
      <font size="2" face="Verdana">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      HTML<input type="radio" value="h" checked name="htm"> PLAIN<input type="radio" name="htm" value="p"></font></td>
        </tr>
      </table>
      </td>
      <td width="50%" align="justify">
      <p align="justify">&nbsp;
</td>
    </tr>
    <tr>
      <td width="50%" align="justify">
      <p align="justify">&nbsp;
</td>
      <td width="50%" align="justify">
      <p align="justify">
<font face="Verdana">&nbsp;&nbsp;
</font>
      </td>
    </tr>
  </table>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
      <td width="100%">

      <p align="center">
<font face="Verdana">
  <b><font size="2">Message:<br>
<textarea style="background-color:#eeeeee;font-size: 13px;color: #000000" name="xmessage" wrap="virtual" class=search cols=69 rows=18><?=$xmessage;?></textarea></font></b></font><p align="center">&nbsp;
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
        <tr>
          <td width="50%">
          <p align="right">
          <input type="submit" value="Submit" name="B1" style="font-family: hooge 05_53; font-size: 8pt; border: 1px solid #C0C0C0; background-color: #EEEEEE"></td>
          <td width="50%">&nbsp;<input type="reset" value="Reset" name="B2" style="font-family: hooge 05_53; font-size: 8pt; border: 1px solid #C0C0C0; background-color: #EEEEEE"></td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
</form>
</p>
<p align="center">
<font face="Verdana" size="2">
<img border="0" src="./images/h1.gif" width="85%" height="1"></font></p>
<?
copyleft();
?>
        </table>
<?
}

#header
###############
function doheader(){
  ?>
<html>
<head>
<title>Anonymous Mailer</title>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
</head>
<style type="text/css">
<!--

.select {
	font: 11px Verdana, Arial, Helvetica, sans-serif;
	background-color:#666666;
	font-weight: bold;
	color: #ffffff;
}
body,p,td{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 13px;
}
 -->
</style>
<body>

 <?
}
#footer
#################
function dofooter(){
?>


</body>
</html>



<?
}



 if (isSet($_SERVER)) {
 if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) {
 $realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
 } elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) {
 $realip = $_SERVER["HTTP_CLIENT_IP"];
 } else {
 $realip = $_SERVER["REMOTE_ADDR"];
 }
 
} else {
 if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
 $realip = getenv( 'HTTP_X_FORWARDED_FOR' );
 } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
 $realip = getenv( 'HTTP_CLIENT_IP' );
 } else {
 $realip = getenv( 'REMOTE_ADDR' );
 }
 }

$host = @gethostbyaddr($realip);
if(!isset($_POST['submitok'])){
    doheader();
	tellform();
    dofooter();
	exit;
}else{
 
$name = $_POST["name"];
$name1 = $_POST["name1"];
$email = $_POST["email"];
$email1 = $_POST["email1"];
$sub = $_POST["sub"];
$xmessage = $_POST["xmessage"];
$realemail = $_POST['realemail'];

//wait wait before move on we need to get some info from mysql :)
$result = mysql_query("SELECT * FROM admin");
while($rec = mysql_fetch_array($result)) {
$notify = $rec['notify'];
$message = $rec['message'];
$webmaster = $rec['webmaster'];
$pmessage = $rec['pmessage'];
}


// NOW! Lets check for Errors         
$displays = " ";
$approve = 1;
      
if(empty($name))
{
 $displays .= "<font color=\"#cc0000\"><b>You must enter your fake or real name</b></font><br />\n";
$approve = 0;
}

if(empty($email))
{
 $displays .= "<font color=\"#cc0000\"><b>You must enter a real or fake email</b></font><br />\n";
$approve = 0;
} else {
if(!eregi("^([a-zA-Z0-9._-])+@([a-zA-Z0-9._-])+\.([a-zA-Z0-9._-])([a-zA-Z0-9._-])+", $email)) {
$displays .= "<font color=\"#cc0000\"><b>Your e-mail you entered was invalid</b></font><br />\n"; 
$approve = 0;
 }
}

if(empty($name1)) {
$displays .= "<font color=\"#cc0000\"><b>Please enter your friends name</b></font><br />\n"; 
$approve = 0;
}

if(empty($email1)) {
$displays .= "<font color=\"#cc0000\"><b>Please enter your friends e-mail</b></font><br />\n"; 
$approve = 0;
} else {

if(!eregi("^([a-zA-Z0-9._-])+@([a-zA-Z0-9._-])+\.([a-zA-Z0-9._-])([a-zA-Z0-9._-])+", $email1)) {
$displays .= "<font color=\"#cc0000\"><b>Your friends e-mail you entered was invalid</b></font><br />\n";
$approve = 0;
 }
}

if(empty($sub)) {
$displays .= "<font color=\"#cc0000\"><b>You have forgotten to enter a subject</b></font><br />\n";
$approve = 0;
}

if(empty($xmessage)) {
 $displays .= "<font color=\"#cc0000\"><b>You must enter a message</b></font><br />\n";
$approve = 0;
}

if($approve == "0") {
echo $displays;
} else {
$approve = 2;
}

dofooter();

//No errors if script reaches this point so MAIL IT !!
$today = date("F j, Y, g:i a");
$name = trim(str_replace("\\'", "'", $name));
$name1 = trim(str_replace("\\'", "'", $name1));
$email = trim(str_replace("\\'", "'", $email));
$email1 = trim(str_replace("\\'", "'", $email1));
$sub = trim(str_replace("\\'", "'", $sub));
$realemail  = trim(str_replace("\\'", "'", $realemail));
$subject = "$sub";


if($htm == 'h') {
$html = "Content-Type: text/html; charset=iso-8859-1\n";
$xmessage = trim(str_replace("\r\n", "<br>", $xmessage));
$xmessage .="<br>$message";
}
else{
$xmessage = trim(str_replace("\r\n", "\r\n", $xmessage));
$xmessage .="$pmessage";
$html = "Content-Type: text/plain; charset=iso-8859-1\n";
}

if($realemail != "") {
$eweee = '"';
$realemails = $name .  "                                                                                      <$realemail>";

$xmessage .= "<p><font size=\"2\">well, i just had to send this email , I just needed to tell you that.<br> Please reply back by: <a href=\"mailto:$realemails?subject=Re: $sub\"> <font color=\"#000080\">Clicking here</font></a><br> Please, thank you</font></p>";

}


if($approve != "0") {
$mailsent=@mail($email1, $subject, $xmessage, "$html"."From: \"$name\"<$email>\r\nX-Sender:$name using $email\r\nReturn-Path: Anonymous\r\nX-Mailer: Amailers $version\r\X-Message-Info: Anonymous\r\Received: Anonymous");
//notify webmaster if need be 
if($notify ==1){
    $message1 = "$name using $email refered $name1 of $email1 to your site";
    $message1.="\nMessage sent from : $realip\nHost is : $host\nDate and time sent: $today";
	$message1.="\nSunject: $sub";
    $message1.="\n\n Sent Message : $xmessage\n";
    @mail($webmaster, "Referal notification", $message1, "$html"."From: \"$name\"<$email>\r\nX-Sender:$name using $email\r\nReturn-Path: $webmaster");
}
if($mailsent){
    doheader();
    

//Now insted of the postign to a log.php file
//we are going to use mySQL!
//Much better, Lets start
 if ($name) {
  $result = mysql_query("INSERT INTO maillog " . "(name, email, name1, email1, sub, xmessage ,today, host, realip, realemail) " .
  "VALUES ('$name', '$email', '$name1', '$email1', '$sub', '$xmessage', '$today', '$host', '$realip', '$realemail')" ,$link_id);

}
		
//Thats the end of the save log.
//Lets move on.
$xmessage = trim(str_replace("\r\n", "<br>", $xmessage));
?>
        <b> Your mail has been sent to:</b> <?=$name1?>
        <br>
        <br>
        <b><u><font color=\"#071378"\>Your information is below</font></u></b>
        <br>
        <b> Your Fake Name:</b> <?=$name?>
        <br>  
        <b> Your Fake E-mail:</b> <?=$email?>
        <br>
        <b> Your Firends E-mail:</b> <?=$email1?>
        <br>
        <b> Your Subject:</b> <?=$sub?>
        <br>
        <b> Your Message:</b><br> <?=$xmessage?>
        <br> 
		<br>
		<center></center>Go to log file:<a href="log.php" style="text-decoration: none"> Log file</a></center>
		<br>
	
    <p />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <center>
              <br />&nbsp;<br />
                 <form action=""><input type="button"value="Click to go back" onclick="history.back()" class="select" /></form>
               </center>
<?
                     dofooter();


 }
} else {
        doheader();
echo "<br><b> Your mail has not been sent</b><p />";
  tellform();
dofooter();

     }
    }
   
   
?>
Return current item: Amailer