Is it possible without connecting phpmailer and the like? You need to send in batches of 100 letters every 5 minutes.

    3 answers 3

    phpmailer is not bad at dealing with this ... I already used it for mailing, did not seem to slow down, although there were not 100 somewhere half or a bit more.

    I think you can poison one copy to everyone, but I sent every new letter. I did this:

    function MailSend($to, $subj, $txt) { $mail = new PHPMailer(true); $mail->IsSMTP(); $mail->Host = "phh.tj"; // SMTP server $mail->SMTPDebug = 0; $mail->SMTPAuth = true; $mail->Host = "phh.tj"; $mail->Port = 25; $mail->Username = "f@phh.tj"; $mail->Password = "***"; $mail->AddReplyTo('f@phh.tj', 'Mailer prikol.tj'); $mail->AddAddress($to, 'User'); $mail->SetFrom('f@phh.tj', 'Mailer prikol.tj'); $mail->AddReplyTo('f@phh.tj', 'Mailer prikol.tj'); $mail->Subject = $subj; $mail->MsgHTML('<table cellpadding="10px" width=500px border=0><tr><td width="250px"><img src="http://prikol.tj/images/logo.png" alt=logo /></td><td style="font-family: arial" width="250">'.$txt.'</td></tr>'); $mail->Send(); } 

    And it all turned in a loop of my users list:

     $mysql = new db; $f=$mysql->query_only_s("SELECT email FROM pr_mailer"); while($row=mysql_fetch_array($f)) { $this->MailSend($row['email'], 'Рассылка сайта PRIKOL.TJ', '<p style="font-size: 13px">'.$txt.'</p><p style="font-size: 11px;">Вы можете отписаться от рассылки пройдя по этой <a href="http://prikol.tj/?do=removeEmail">ссылке</a>.</p>'); } 

    The main thing do not forget to include it-class.phpmailer.php

    • But about phpmailer you can more in detail how to achieve sending in batches? at a hoster the limit costs for a while script execution. - Ruslan Librovsky
    • Well, I can implement all this without smtp authorization and through simple mail () Phpmailer can send say 100 letters and in an hour another 100 letters but next in the list? - Ruslan Librovsky September
    • You have to implement the algorithm yourself, keep the general list in the database, output the data (example: SELECT id, mail WHERE sts! = 1 LIMIT 100) then each time you send a letter, indicate that you have already sent it (whistle sts = 1 to each sent ). It is possible to start with a delay only with cron-ohm if the hoster gives you this opportunity. I can not understand, do you need ready-made codes or just help with the algorithm? - Farhod
    • Thanks algorithm understood. I just thought that phpmailer itself can store a list of those who sent it and who needs to send it. The hoster limits are on sending 100 emails per hour. I thought on the site to make a notification that a new task appeared. but with limits it is not possible to organize it already via Twitter ... - Ruslan Librovsky
    • one
      And what you do not like SMTP? it can be configured for different mail servers ... mail.ru, gmail.com, etc. ... PHPMailer can do it! there will already be dependent on mail servers. you will send several mailers to the list and send them one by one ... - Yoharny Babay

    Adjust cron, the easiest way.

    • Through cron, I do not understand how? there is an array with addresses. it turns out that he will be sending the same ... - Ruslan Librovsky
    • 1. The script is called on the crown 2. It is checked to whom it sent and to whom it is necessary to send 3. 100 is selected and sent 4. These 100 sent ones are added to those already sent and will not be sent anymore. It is only necessary to think about how to store the list of sent ones, but this already depends on the system, it is possible in the database, it is possible in the memory cache. - Dem

    Well, make a script with delays. Or customize cron. Options - the sea.