АРМАДА
Скрипт Для Email Рассылки
Новая тема Написать ответ Advanced Hosters - профессиональный хостинг

tvsm22
Профессионал
Зарегистрирован: 03.03.2008
Сообщений: 556
Обратиться по нику
# Добавлено:Вт Мар 03, 2009 4:47 pmДобавить в избранноеОтветить с цитатой
Подскажите плиз скрипт
Нужно порядка 200 сообщений пару раз в неделю рассылать, хочу поставить и забыть

Ну или хотя бы без автомата
sabirovsk.ru - Игровое оборудование для детских садов

Жека
V.I.P.
Зарегистрирован: 07.12.2005
Сообщений: 2173
Обратиться по нику
# Добавлено:Вт Мар 03, 2009 5:10 pmОтветить с цитатой
Использовал когда-то MassEmailer

Код:
<?php
//
// ================================================================
//                    M A S S   E - M A I L E R
// ================================================================
//
   $version = "Version 1.0 / 22.02.2003";
//
//
// ===================== CONFIGURATION BEGIN ======================
//


//
// If $stopmail is set to 1 there will be sent just a confirmation
// message ! All other E-Mails will not be sent ! This is only for
// testing ! If you want to send E-Mails set the value to 0 !
//
$stopmail = 0;


//
// E-mail address of the sender.
//
$senderemail = "magadmin@rambler.ru";


//
// Address for the confirmation E-mail.
//
$confirmationemail = "magadmin@rambler.ru";


//
// Value of the subject at the beginning.
//
$mailsubject = "E-Mailer";


//
// Path of the list directory.
//
$listdir = "/www/mail/";


//
// Names of the address files.
//
$address01 = "address01.txt";
$address02 = "address02.txt";
$address03 = "address03.txt";
$address04 = "address04.txt";
$address05 = "address05.txt";
$address06 = "address06.txt";
$address07 = "address07.txt";
$address08 = "address08.txt";
$address09 = "address09.txt";
$address10 = "address10.txt";


//
// Wait time before sending the next E-Mail.
//
// The time has to be in seconds !
//
$waittime = 0.2;


//
// ====================== CONFIGURATION END =======================
//


// ================================================================
// Display html header with the style sheet definitions.
// ================================================================
//
switch($todo) {
  case "":
    $page = "E-Mail Form";
    break;

  case "Change this list !":
    $page = "Change List";
    break;

  case "Save this List !":
    $page = "Save List";
    break;

  case "Send E-Mails !":
    $page = "Send E-Mails";
    break;
}


?>


<html>
  <head>
    <title>Mass E-Mailer</title>
    <style type="text/css">
      <!--
      body { font-family:arial;
             background-color:#99CCFF }

      h1 { font-size:20pt; }

      a:link { color:#000066;
               text-decoration:none }

      a:visited { color:#000066;
                  text-decoration:none }

      a:active { color:#CC0033;
                 text-decoration:none }

      .tableleft { color:#000066;
                   font-size:12pt;
                   font-weight:bold;
                   vertical-align:top;
                   width:260px; }

      .bottomtable { width:600px; }

      .bottomcell { text-align:center; }

      .linkcell { text-align:center;
                  font-size:14pt;
                  width:150px; }

      .copyright { text-align:center;
              font-size:10pt;
              color:#CC0033; }
      -->
    </style>
  </head>
  <body>
    <table width="100%" height="100%">
      <tr>
        <td>
          <form method="post" action="emailer.php">
            <table align="center">
              <tr>
                <td>
                  <h1>
                    Mass E-Mailer - <?php echo $page; ?>
                  </h1>
                </td>
              </tr>
            </table>

<?php
if($todo == "") {


// ================================================================
// Display E-Mail form.
// ================================================================
//
?>
            <table align="center" cellspacing="1">
              <tr>
                <td class="tableleft">
                  Path to the recipient address file:
                </td>
                <td>
                  <select name="addressfile" size="1">
                    <option>
                      <?php echo $address01; ?>
                    </option>
                    <option>
                      <?php echo $address02; ?>
                    </option>
                    <option>
                      <?php echo $address03; ?>
                    </option>
                    <option>
                      <?php echo $address04; ?>
                    </option>
                    <option>
                      <?php echo $address05; ?>
                    </option>
                    <option>
                      <?php echo $address06; ?>
                    </option>
                    <option>
                      <?php echo $address07; ?>
                    </option>
                    <option>
                      <?php echo $address08; ?>
                    </option>
                    <option>
                      <?php echo $address09; ?>
                    </option>
                    <option>
                      <?php echo $address10; ?>
                    </option>
                  </select>
                  <input type="submit" name="todo" value="Change this list !">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  Path to a special file:
                </td>
                <td>
                  <input type="text" name="specialfile" size="60">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  Wait time for sending (in sec.):
                </td>
                <td>
                  <input type="text" name="wait" size="10" value="<?php echo $waittime; ?>">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  E-Mail address of the sender:
                </td>
                <td>
                  <input type="text" name="sender" size="60" value="<?php echo $senderemail; ?>">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  E-Mail address for confirmation:
                </td>
                <td>
                  <input type="text" name="confirmation" size="60" value="<?php echo $confirmationemail; ?>">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  E-Mail subject:
                </td>
                <td>
                  <input type="text" name="subject" size="60" value="<?php echo $mailsubject ?>">
                </td>
              </tr>
              <tr>
                <td class="tableleft">
                  E-Mail message:
                </td>
                <td>
                  <textarea name="message" rows="14" cols="50"></textarea>
                </td>
              </tr>
            </table>
            <table align="center" class="bottomtable">
              <tr>
                <td>
                  &nbsp;
                </td>
              </tr>
              <tr>
                <td class="bottomcell">
                  <input type="reset" name="reset" value="Reset Form">
                  <input type="submit" name="todo" value="Send E-Mails !">
                  <?php if($stopmail == 1) { echo "<b>Testmode active !</b>"; } ?>
                </td>
              </tr>
            </table>

<?php
}


if($todo == "Change this list !") {


// ================================================================
// Change lists.
// ================================================================
//


// ================================================================
// Display title for the change form.
// ================================================================
//
?>


            <table align="center">
              <tr>
                <td>
                  <b>
                    Open file: <?php echo $addressfile; ?>
                  </b>
                </td>
              </tr>

<?php
// ================================================================
// Try to open the selected address file.
// ================================================================
//
  $success = 0;
  echo "<tr>";
  echo "<td> ";
  $address = $listdir.$addressfile;
  if (@file_exists($address)) {
    if($changefile = @fopen ($address, "r")) {
//    echo "The file <b>\"".$addressfile."\"</b> was opened successfuly !<br>";
      $success = 1;
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be opened !<br>";
    }
  } else {
    echo "There is no file <b>\"".$address."\"</b> !<br>";
  }
  echo "</td>";
  echo "</tr>";


// ================================================================
// Insert data to the textbox.
// ================================================================
//
  if ($success == 1) {
    echo "<tr>";
    echo "<td> ";
    echo "<textarea name=\"email\" rows=\"23\" cols=\"70\">";
    while($line = @fgets($changefile,1024)) {
      echo @trim(stripslashes($line))."\n";
    }
    echo"</textarea>";
    echo "</td>";
    echo "</tr>";


// ================================================================
// Close the address file.
// ================================================================
//
    echo "<tr>";
    echo "<td> ";
    if(@fclose ($changefile)) {
//    echo "The file <b>\"".$addressfile."\"</b> was closed successfuly !<br>";
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be closed !<br>";
    }
    echo "</td>";
    echo "</tr>";
    echo "</table>";
  }


// ================================================================
// Display buttons.
// ================================================================
//
?>


  <table align="center" class="bottomtable">
    <tr>
      <td>
        &nbsp;
      </td>
    </tr>
    <tr>
      <td class="bottomcell">
        <input type="reset" name="todo" value="Reset Form">
        <input type="submit" name="todo" value="Save this List !">
        <input type="hidden" name="listdir" value="<?php echo $listdir; ?>">
        <input type="hidden" name="addressfile" value="<?php echo $addressfile; ?>">
      </td>
    </tr>
  </table>


<?php
}


if($todo == "Save this List !") {

// ================================================================
// Save changes to text file.
// ================================================================
//


// ================================================================
// Try to open the selected address file.
// ================================================================
//
  $success = 0;
  echo "<table align=\"center\">";
  echo "<tr>";
  echo "<td> ";
  $address = $listdir.$addressfile;
  if (@file_exists($address)) {
    if($savefile = @fopen ($address, "w")) {
      echo "The file <b>\"".$addressfile."\"</b> was opened successfuly !<br>";
      $success = 1;
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be opened !<br>";
    }
  } else {
    echo "There is no file <b>\"".$address."\"</b> !<br>";
  }
  echo "</td>";
  echo "</tr>";


// ================================================================
// Write data in to the address file.
// ================================================================
//
  if ($success == 1) {
    echo "<tr>";
    echo "<td> ";
    if (!@fwrite($savefile,$email)) {
      echo "Cannot write to file <b>\"".$addressfile."\"</b> !<br>";
      echo "</td>";
      echo "</tr>";
      echo "<tr>";
      echo "<td> ";
      echo "The file permission has to be <b>777</b> !";
      echo "</td>";
      echo "</tr>";
    } else {
      echo "The file <b>\"".$addressfile."\"</b> was saved successfuly !";
    }
    echo "</td>";
    echo "</tr>";



// ================================================================
// Close the address file.
// ================================================================
//
    echo "<tr>";
    echo "<td> ";
    if(@fclose ($savefile)) {
      echo "The file <b>\"".$addressfile."\"</b> was closed successfuly !<br>";
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be closed !<br>";
    }
    echo "</td>";
    echo "</tr>";
    echo "</table>";
  }


// ================================================================
// Reset the variable $todo to get back to the E-Mail form.
// ================================================================
//
  $todo == "";
}


if($todo == "Send E-Mails !") {

// ================================================================
// Sending the E-Mails.
// ================================================================
//

// ================================================================
// The variables are initialized.
// ================================================================
//
  $status = ""; // Describes the mailing status.
  $counter = 0; // Counts the E-Mails which has been sent.


// ================================================================
// Display title for the protocol.
// ================================================================
//
  echo "<table align=\"center\">";
  echo "<tr>";
  echo "<td>";
  echo "<hr>";


// ================================================================
// Check if there is a special file to open or if it's necessary
// to choose a address list from the drop down menu.
// ================================================================
//
  if ($specialfile != "") {
    echo "There was an input in the \"special path\" field ...<br>";
    $address = $specialfile;
  } else {
    echo "There was no input in the \"special path\" field ...<br>";
    $address = $listdir.$addressfile;
  }


// ================================================================
// Try to open the selected address file.
// ================================================================
//
  echo "Try to open the file <b>\"".$address."\"</b> ...<br>";
  if (@file_exists($address)) {
    echo "The file <b>\"".$address."\"</b> was found ...<br>";
    if($afile = @fopen ($address, "r")) {
      echo "The file <b>\"".$addressfile."\"</b> was opened successfuly !<br>";
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be opened !<br>";
    }
  } else {
    echo "There is no file <b>\"".$address."\"</b> !<br>";
    $status = "There is no file \"".$address."\" ...";
  }


// ================================================================
// If the file exists then reads addresses until end of file.
// ================================================================
//
  echo "Trying to read the file <b>\"".$address."\"</b> ...<br>";
  if (@file_exists($address)) {

    while (!feof($afile)) {


// ================================================================
// Reads one line.
// ================================================================
//
      $line = fgets($afile, 1024);
      $line = trim($line);
      echo "<br>";
      echo "Reading the address <b>\"".$line."\"</b> ...<br>";


// ================================================================
// Initialize the address cache.
// ================================================================
//
      $recipient = "";


// ================================================================
// Insert new address to cache.
// ================================================================
//
      $recipient = $line;


// ================================================================
// Prepare the header for the e-mail.
// ================================================================
//
      $header    = "From: ".$sender."\r\n";
      $header   .= "Reply-To: ".$sender."\r\n";
      $header   .= "Errors-To: ".$sender."\r\n";
      $header   .= "X-Mailer: PHP / ".phpversion()."\r\n";


// ================================================================
// Create test pattern.
// ================================================================
//
      $pattern="#^[-!\#$%&\"*+\\./\d=?A-Z^_|'a-z{|}~]+";
      $pattern.="@";
      $pattern.="[-!\#$%&\"*+\\/\d=?A-Z^_|'a-z{|}~]+\.";
      $pattern.="[-!\#$%&\"*+\\./\d=?A-Z^_|'a-z{|}~]+$#";


// ================================================================
// Check if recipient E-Mail address is not empty.
// ================================================================
//
      if($recipient != "")
      {


// ================================================================
// Check if recipient E-Mail address is valid.
// ================================================================
//
        if(preg_match($pattern,$recipient))
        {


// ================================================================
// Sending the e-mail to the recipient.
// ================================================================
//
          echo "Sending an E-Mail to <b>\"".$recipient."\"</b> ...<br>";
          if($stopmail != "1") {

            if(@mail($recipient, stripslashes($subject), stripslashes($message), stripslashes($header))) {
              $counter = $counter + 1;
              echo "E-Mail <b>\"".$counter."\"</b> at ".date("H:i:s")." was sent successfuly !<br>";
            } else {
              echo "This E-Mail could not be sent !<br>";
            }
          } else {
              $counter = $counter + 1;
              echo "E-Mail <b>\"".$counter."\"</b> at ".date("H:i:s")." was sent successfuly (Testmode) !<br>";
          }
        } else {
          echo "The recipient E-Mail address is not valid !";
          echo "<br>";
        }
      } else {
        echo "The recipient E-Mail address is empty or it is the end of data !";
        echo "<br>";
      }


// ================================================================
// If necessary and the E-Mails can not send that fast here is
// a loop to make a little break after all E-Mails.
// ================================================================
//
      $sec = $wait * 1000000;
      usleep($sec);

    }


// ================================================================
// Check if confirmation E-Mail address is not empty.
// ================================================================
//
    if($confirmation != "")
    {


// ================================================================
// Check if confirmation E-Mail address is valid.
// ================================================================
//
      if(preg_match($pattern,$confirmation))
      {


// ================================================================
// Sending a confirmation E-Mail.
// ================================================================
//
        echo "<br>";
        echo "Sending a confirmation E-Mail to <b>\"".$confirmation."\"</b> ...<br>";
        $subject = "Confirmation - ".$subject;

        if(@mail($confirmation, stripslashes($subject), stripslashes($message), stripslashes($header))) {
          $counter = $counter + 1;
          echo "E-Mail <b>\"".$counter."\"</b> at ".date("H:i:s")." was sent successfuly !<br>";
        } else {
          echo "This E-Mail could not be sent !<br>";
        }
      } else {
        echo "<br>";
        echo "The confirmation E-Mail address is not valid !";
      }
    } else {
      echo "<br>";
      echo "The confirmation E-Mail address is empty !";
    }


// ================================================================
// Close the address file.
// ================================================================
//
    echo "<br>";
    if(@fclose ($afile)) {
      echo "The file <b>\"".$addressfile."\"</b> was closed successfuly !<br>";
    } else {
      echo "The file <b>\"".$addressfile."\"</b> could not be closed !<br>";
    }
  } else {
    echo "Could not read the file <b>\"".$afile."\"</b> ...<br>";
  }


// ================================================================
// If everything is OK the status message displays the number
// of sent E-Mails.
// ================================================================
//
  if ($status == "") {
    $status ="Status: ".$counter." E-Mails were sent !";
    echo "<br>";
    echo "$status";
    echo "<hr>";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
  }

}


// ================================================================
// Display html footer with a close link.
// ================================================================
//
?>
              <table align="center" class="bottomtable">
                <tr>
                  <td colspan="4">
                    &nbsp;
                  </td>
                </tr>
                <tr>
                  <td class="linkcell">
                    <a href="javascript:window.close()">
                      Close Window
                    </a>
                  </td>
                  <td class="linkcell">
                    <a href="emailer.php">
                      E-Mail Form
                    </a>
                  </td>
                  <td class="linkcell">
                    <a href="javascript:history.back()">
                      Back
                    </a>
                  </td>
                  <td class="linkcell">
                    <a href="docu/emailer.pdf" target="_blank">
                      Help
                    </a>
                  </td>
                </tr>
                <tr>
                  <td colspan="4">
                    &nbsp;
                  </td>
                </tr>
                <tr>
                  <td colspan="4" class="copyright">
                    &copy; 2003 by <a href="mailto:biegel@gmx.ch">Patrick Biegel</a>, <?php echo $version; ?>
                  </td>
                </tr>
              </table>
            </table>
          </form>
        </td>
      </tr>
    </table>
  </body>
</html>

Подпись

IseeDeadPeople
Объединенная Электрическая
Зарегистрирован: 06.12.2005
Сообщений: 21153
Обратиться по нику
# Добавлено:Вт Мар 03, 2009 5:21 pmОтветить с цитатой
[offtop]
вообще проблема не в том чем рассылать..
а откуда, .. и пхп скрипт просто написать - но если еще нужна база и пониселектирование..

и если все легально, - делай как я..
когда у меня была партнерка..
я поставил локальный SMTP пони, + МассМаилер~ локальный (шарный, но до 100 за 1 раз работате.. т.е. можно хоть и 10000 прогнать лошадок...)
[/offtop]
ConnectX: Единый порно сайт подрочить Porno Cam, для adult вебмастеров, webcam моделей

Sterx +
Опытный
Зарегистрирован: 08.10.2007
Сообщений: 252
Обратиться по нику
# Добавлено:Ср Мар 04, 2009 8:24 amОтветить с цитатой
phpmailer
аккаунты адалт партнерок за 50%

shhef +
V.I.P.
Зарегистрирован: 14.09.2007
Сообщений: 7694
Обратиться по нику
# Добавлено:Ср Мар 04, 2009 8:27 amОтветить с цитатой
Почтовый дятел :thup:
Облачный сервер за 5 у.е. + 10 у.е на счет при регистрации по моей ссылке. Разные страны! Лучший треккер!
Новая тема Написать ответ    ГЛАВНАЯ ~ ТЕХНИЧЕСКИЕ ВОПРОСЫ

Перейти:  





Генеральный спонсор



Партнеры