The Email Class is a CodeIgniter gem. It enables you to easily send e-mails from your application; this is great for simple contact forms, and even mailing lists for handling thousands of e-mails. The Email Class also serves as a wrapper class. This means that you can change the way that e-mails are sent, without having to change any of your Controller's code. You can choose between the standard PHP mail function, sendmail, or even Simple Mail Transfer Protocol (SMTP).
To get us started with the Email Class, we'll simply send an e-mail using the PHP mail function, which is also the default option for this library. To start using the library, you need to load it in the same way as you would any other library.
$this->load->library('email');
The next thing that we will need to do is to set our e-mail parameters, the sender, the recipient, any e-mail address to send a carbon copy or blind carbon copy to, the subject of our e-mail, and the message body. Take a look...