Email Configuration in CodeIgniter

hey guys,

lets see how to configure email in codeigniter today..

1. Create a page name email.php in project/application/config/

copy this code over there..

<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);
$config[‘protocol’] = ‘smtp’;
$config[‘smtp_host’] = ‘’;
$config[‘smtp_port’] = 25;


2. Goto your controller page..just paste this below code where ever it requires to send a mail..

$this->load->library(’email’, $config);
$this->email->from(‘’, ‘Company Name/Admin’);

$this->email->to($empemail / ‘’);

$this->email->subject(‘Related Subject’);
$this->email->message(‘Your message ..’);


echo $this->email->print_debugger();

Thats it..very simple..right 😉

Reference Link : Click , another


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s