Announcement

Collapse
No announcement yet.

Is it possible to split an e-mail addressed array into batches ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Almost.

    if($c_count > 1 && $i < $c_count) //skip the sleep if only one batch or the last one
    {
    sleep(600);
    }

    No else. Sorry my bad.

    jsb

    Comment


    • #17
      Hi Jsb,

      I did the modification but now it says.. variable $c_count not defined.


      ==========
      $chunk_size = 100;
      $i = 0;
      $email_to = array_chunk(explode(';',$email_to_all),$chunk_size );
      while(isset($email_to[$i]))
      {
      if(empty({email_attachment})){
      sc_mail_send([glo_mail_smtp_server], [glo_mail_smtp_user], [glo_mail_smtp_pass], $mail_from , $mail_from , {subject}, $message, "H", $email_to[$i] , $type_copy , [glo_mail_smtp_port],[glo_mail_smtp_ssl]);
      }
      else{
      sc_mail_send([glo_mail_smtp_server], [glo_mail_smtp_user], [glo_mail_smtp_pass], $mail_from , $mail_from , {subject}, $message, "H", $email_to[$i] , $type_copy , [glo_mail_smtp_port],[glo_mail_smtp_ssl], $email_attach);
      }
      if($c_count > 1 && $i < $c_count) //skip the sleep if only one batch or the last one
      {
      sleep(600);
      }
      $i ++;
      }

      Comment


      • #18
        Hi,
        you need to set the variable.

        $chunk_size = 100;
        $i = 0;
        $email_to = array_chunk(explode(';',$email_to_all),$chunk_size );

        $c_count = count($email_to); // number of chuncks

        while(isset($email_to[$i]))
        {
        ...

        jsb

        Comment


        • #19
          OK , many thanks.
          Now I'll wait that a massive test woud be done !!
          Bye

          Comment

          Working...
          X