I have a table (MySQL) in which records with email are stored. I need to send messages to my users. Advise how to do it better. What difficulties (lightness) I will face. Are there any ready-made examples (analogs)? What can you advise on this issue? Everyone will be very grateful.

Closed due to the fact that off-topic participants are Visman , cyadvert , PashaPash , Vladimir Glinskikh , aleksandr barakin 24 Oct '15 at 8:51 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Questionnaires are forbidden on Stack Overflow in Russian . To get an answer, rephrase your question so that it can be given an unambiguously correct answer." - Visman, cyadvert, Vladimir Glinskikh, aleksandr barakin
If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    I think this is about using crontab . Somewhere on the server should be a php-file, which when launched will produce a mailing. The file must have the rights 705, in its very first line (before "<? Php") the path to the interpreter should be specified, for example. "#! / usr / local / bin / php". If you are using a virtual hosting service, then it is best to ask a question to the provider.

      It is possible and without Krontab, if you personally control this business. It is less stable, but in the absence of options, it will roll.

      A page is made with the launch form, fields: Address for answer, Title, Message, Start with ...

      The form is sent by Ajax. In the form handle, the following happens: the next soap is taken, a letter is sent, the result is returned in the form "Sent to% EMAIL%". If this soap is not the last one, the callback function changes the "start from ..." field and sends the next request, otherwise it writes something like "sending is completed". In this situation, if the Internet suddenly disappears / the server / something else collapses, the form will remain on the last request and it can be continued.

      For reflection:

      $num = intval(isset($_POST['num'])?$_POST['num']:0); /* запрос "дайте следующее мыло" */ $em_res = mysql_query('SELECT * FROM emails WHERE 1=1 LIMIT '.$num.', 1;'); if ($email = mysql_fetch_object($em_res)) { /* шлем письмо, докладываем о результатах */ } else { echo 'Рассылка завершена'; } 

      Shl I allocate: this is a crutch aka hack and so do wrong =)

      ZZY on ready I can advise Google , not from laziness, but to understand that these scripts are legion.