O'Reilly logo

CodeIgniter 1.7 Professional Development by Adam Griffiths

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Email Class

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).

Send an e-mail

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'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required