You are here: Home » Others » Codeigniter » Mail in codeigniter

Mail in codeigniter

24 Flares 24 Flares ×

To use email in codeigniter, use below code, first load email library by using $this->load->library(’email’);.
After it define to,from,subject and message, you can also use cc and bcc. At end use $this->email->send(); to send mail.


$this->email->from('', 'Your Name');

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');


To debug mail use echo $this->email->print_debugger();
You can set name of sender as $this->email->from(‘’, ‘Your Name’);
For repply use $this->email->reply_to(‘’, ‘Your Name’);

To create multiple recipient address use
$list = array(‘’, ‘’, ‘’);

$this->email->to($list); Same will be use for cc and bcc.
Use $this->email->clear(); to clear all value to an empty.

About Abhishek Sinha

I am Abhishek and I love to code on PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *


Scroll To Top
24 Flares Twitter 0 Facebook 0 Google+ 0 StumbleUpon 7 Pin It Share 8 LinkedIn 9 24 Flares ×