RalphLeMouf Posted August 14, 2012 Share Posted August 14, 2012 hey there - I am setting up a system that when a new account is created, the new user is sent an email with a confirmation email that has hashed token link to it for security. I'm getting confirmation that emails are being sent via $this->email->print_debugger(); however, I've only been able to receive one email. I'm wondering if all of my configurations for my server ( as I'm developing locally) are set up properly, as well as my code flow being correct. CONTROLLER: $this->load->model('user_model'); if($query = $this->user_model->create_member()) { $this->load->model('user_model'); $this->varification_email(); $data['main_content'] = 'account/welcome'; $this->load->view('includes/templates/main_page_template', $data); } else { $this->load->view('home/home_page'); } } } function varification_email() { $query = $this->db->query('SELECT * FROM users order by id desc LIMIT 1'); foreach ($query->result() as $user) { $this->load->library('email'); $this->email->from('noreply@blah.com', 'blahblahblah'); $this->email->to($user->email); echo $user->email; $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); $this->email->send(); echo $this->email->print_debugger(); } } MODEL: Also, I'm assuming it's okay to do this ONLY on my controller with no involvement with a model? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/267087-sending-email-with-codeigniter/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.