Welcome Guest, Not a member yet? Register   Sign In
Sending Multiple Emails
#1

[eluser]JuanitoDelCielo[/eluser]
Hi guys, I have one problem. I want to send 800 emails but I'm not sure how can I do it.

Simple, but the 30segs per execution its not enough to send the whole 800 emails.

Code:
class theemail extends CI_Controller {

  public function send()
  {
    $users = $this->db->get('users');
    foreach($user->result() as $user){
      //Send email
    }
  }

}

Send a redirect ... send and redirect

Code:
class theemail extends CI_Controller {

  public function send()
  {
    $users = $this->db->get('users');
    redirect('theemail/do_send/1/' . $users->num_rows());
  }

  public function do_send( $id, $to ){
    
    if($id > $to) {  $this->load->view('succesfull view'); }

    $this->db->get_where('users', array('id' => $id));
    //sendemail
    redirect('theemail/do_send/' . $id+1 . '/' . $to)

  }

}

Also I read about the cron jobs but I have never used it.




Theme © iAndrew 2016 - Forum software by © MyBB