$query = $this->db->get('Tbl_emails'); $this->load->library('email'); foreach ($query->result() as $row) { $this->email->from('youremail@com', 'Your Name'); $this->email->to($row->email); $this->email->subject('your subject'); $this->email->message('your body'); $this->email->send(); sleep(1); }
$query = $this->db->get('Tbl_emails'); $this->load->library('email'); foreach ($query->result() as $row) { $this->email->from('youremail@com', 'Your Name'); $this->email->to($row->email); $this->email->subject('your subject'); $this->email->message('your body'); $this->email->send(); if ( ! $this->email->send()) { // Generate error or handle it! } else { $this->email->clear(TRUE); } }
$this->email->send();