Want more features on Pastebin? Sign Up, it's FREE!
Guest

InboX Mass Mailer

By: a guest on Jan 27th, 2012  |  syntax: PHP  |  size: 5.65 KB  |  views: 2,538  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. if(isset($_POST['action'] ) ){
  4. $action=$_POST['action'];
  5. $message=$_POST['message'];
  6. $emaillist=$_POST['emaillist'];
  7. $from=$_POST['from'];
  8. $replyto=$_POST['replyto'];
  9. $subject=$_POST['subject'];
  10. $realname=$_POST['realname'];
  11. $file_name=$_POST['file'];
  12. $contenttype=$_POST['contenttype'];
  13.  
  14.         $message = urlencode($message);
  15.         $message = ereg_replace("%5C%22", "%22", $message);
  16.         $message = urldecode($message);
  17.         $message = stripslashes($message);
  18.         $subject = stripslashes($subject);
  19. }
  20.  
  21.  
  22. ?>
  23. <html>
  24. <head>
  25. <title>|| InboX Mass Mailer ||</title>
  26. <meta http-equiv="Content-Type" content="text/html;
  27. charset=iso-8859-1">
  28.  
  29. <style type="text/css">
  30. <!--
  31. .style1 {
  32.         font-family: Geneva, Arial, Helvetica, sans-serif;
  33.         font-size: 12px;
  34. }
  35. -->
  36. </style>
  37. <style type="text/css">
  38. <!--
  39. .style1 {
  40.         font-size: 20px;
  41.         font-family: Geneva, Arial, Helvetica, sans-serif;
  42. }
  43. -->
  44. </style>
  45. </head>
  46. <body bgcolor="FF9900" text="#ffffff">
  47. <span class="style1">InboX Mass Mailer<br>
  48.  
  49. </span>
  50.  
  51. <form name="form1" method="post" action=""
  52. enctype="multipart/form-data">
  53.   <br>
  54.   <table width="100%" border="0">
  55.     <tr>
  56.       <td width="10%">
  57.         <div align="right"><font size="-3" face="Verdana, Arial,
  58. Helvetica, sans-serif">Your
  59.           Email:</font></div>
  60.       </td>
  61.       <td width="18%"><font size="-3" face="Verdana, Arial, Helvetica,
  62. sans-serif">
  63.         <input type="text" name="from" value="<? print $from; ?>"
  64. size="30">
  65.         </font></td>
  66.       <td width="31%">
  67.         <div align="right"><font size="-3" face="Verdana, Arial,
  68. Helvetica, sans-serif">Your
  69.           Name:</font></div>
  70.       </td>
  71.       <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica,
  72. sans-serif">
  73.         <input type="text" name="realname" value="<? print $realname;
  74. ?>" size="30">
  75.         </font></td>
  76.     </tr>
  77.     <tr>
  78.       <td width="10%">
  79.         <div align="right"><font size="-3" face="Verdana, Arial,
  80. Helvetica, sans-serif">Reply-To:</font></div>
  81.       </td>
  82.       <td width="18%"><font size="-3" face="Verdana, Arial, Helvetica,
  83. sans-serif">
  84.         <input type="text" name="replyto" value="<? print $replyto; ?>"
  85. size="30">
  86.         </font></td>
  87.       <td width="31%">
  88.         <div align="right"><font size="-3" face="Verdana, Arial,
  89. Helvetica, sans-serif">Attach
  90.           File:</font></div>
  91.       </td>
  92.       <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica,
  93. sans-serif">
  94.         <input type="file" name="file" size="30">
  95.         </font></td>
  96.     </tr>
  97.     <tr>
  98.       <td width="10%">
  99.         <div align="right"><font size="-3" face="Verdana, Arial,
  100. Helvetica, sans-serif">Subject:</font></div>
  101.       </td>
  102.       <td colspan="3"><font size="-3" face="Verdana, Arial, Helvetica,
  103. sans-serif">
  104.         <input type="text" name="subject" value="<? print $subject; ?>"
  105. size="90">
  106.         </font></td>
  107.     </tr>
  108.     <tr valign="top">
  109.       <td colspan="3"><font size="-3" face="Verdana, Arial, Helvetica,
  110. sans-serif">
  111.         <textarea name="message" cols="50" rows="10"><? print $message;
  112. ?></textarea>
  113.         <br>
  114.         <input type="radio" name="contenttype" value="plain" >
  115.         Plain Text
  116.         <input name="contenttype" type="radio" value="html" checked>
  117.         HTML
  118.         <input type="hidden" name="action" value="send">
  119.         <input type="submit" value="Send eMails">
  120.         </font></td>
  121.       <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica,
  122. sans-serif">
  123.         <textarea name="emaillist" cols="30" rows="10"><? print
  124. $emaillist; ?></textarea>
  125.         </font></td>
  126.     </tr>
  127.   </table>
  128.  
  129. </form>
  130.  
  131.  
  132.  
  133. <?
  134.  
  135. if ($action){
  136.  
  137.         if (!$from && !$subject && !$message && !$emaillist){
  138.         print "Please complete all fields before sending your
  139. message.";
  140.         exit;  
  141.         }
  142.         $allemails = split("\n", $emaillist);
  143.                 $numemails = count($allemails);
  144.        
  145.           for($x=0; $x<$numemails; $x++){
  146.                 $to = $allemails[$x];
  147.                 if ($to){
  148.                 $to = ereg_replace(" ", "", $to);
  149.                 $message = ereg_replace("&email&", $to, $message);
  150.                 $subject = ereg_replace("&email&", $to, $subject);
  151.                 print " $to.......";
  152.                 flush();
  153.                 $header = "From: $realname <$from>\r\nReply-To: $replyto\r\n";
  154.                 $header .= "MIME-Version: 1.0\r\n";
  155.                     If ($file_name) $header .= "Content-Type: multipart/mixed; boundary=$uid\r\n";
  156.                   If ($file_name) $header .= "--$uid\r\n";
  157.                 $header .= "Content-Type: text/$contenttype\r\n";
  158.                 $header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
  159.                 $header .= "$message\r\n";
  160.                     If ($file_name) $header .= "--$uid\r\n";
  161.                     If ($file_name) $header .= "Content-Type: $file_type; name=\"$file_name\"\r\n";
  162.                     If ($file_name) $header .= "Content-Transfer-Encoding: base64\r\n";
  163.                     If ($file_name) $header .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n\r\n";
  164.                     If ($file_name) $header .= "$content\r\n";
  165.                     If ($file_name) $header .= "--$uid--";
  166.                 mail($to, $subject, "", $header);
  167.                 print "spammed<br>";
  168.        
  169.                 flush();
  170.                 }
  171.                 }
  172. }
  173.  
  174.  
  175. ?>
  176. <style type="text/css">
  177.  
  178. <!--
  179. .style1 {
  180.         font-size: 20px;
  181.         font-family: Geneva, Arial, Helvetica, sans-serif;
  182. }
  183. -->
  184. </style>
  185. <p class="style1">
  186. Copyright © 2008 phpbb.com
  187. </p>
  188. <?php
  189. if(isset($_POST['action']) && $numemails !==0 ){echo
  190. "<script>alert('Mail sending complete\\r\\n$numemails mail(s) was sent successfully');
  191. </script>";}
  192. ?>
  193. </body>
  194. </html>
clone this paste RAW Paste Data