O'Reilly logo

Programming with CodeIgniter MVC by Yehuda Zadik, Eli Orr

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

Example 2 – sending e-mails with attachments

In this example, we will see how the controller can load a mail service library and use it to send mail attachments.

The CI mail library is not an auto-loaded library, and hence, will be loaded by the controller we are building for sending e-mail.

The CI mail library makes it easy to send subject messages of non-English languages supporting UTF-8 both for the subject and the mail body. Adding attachments to an e-mail becomes a piece of cake using the CI mail library. We only need to have the files on a known directory path in our server and refer to them to attach them to the mail.

We can attach one or more files to create the mail body. HTML/TEXT is defined via a simple configuration setting to the CI ...

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