codeigniter Sending Email Load The Email Library


First you need to load the email library.

Do this either in the controller file that will be sending the email:


Or load it globally in the autoload.php file in the config folder:

$autoload['libraries'] = array('email');

While you're there, you may want to load the email helper if you want to use some of CodeIgniter's built in shortcuts:

$autoload['helper'] = array('email');

The email helper can be loaded in the Controller file in a similar way to the email library: