2007年11月17日土曜日

foreach ($list->result() as $address) {

    $this->email->clear();

    $this->email->to($address->email);

    $this->email->from($this->config->item('admin_email'), 'Name');

    $this->email->subject('Newsletter for ' . date ("F jS, Y"));

    $this->email->message($this->load->view('newsletter/daily_newsletter', $data, true));

    $email_sent = $this->email->send();



// this is assigned to a var rather then just

// if ($this->email->send()) because I needed to manually

// toggle that back and forth, and it just seemed easier



    if ($email_sent) {

        $this->user_model->update_sent_issue($address->email, $issueNumber);

        $output .= '
  • ' . $address->email . '
  • ';
        } else {

            $output .= '
  • Could not send to ' . $address->email . '
  • ';
        }

    0 件のコメント: