I really do enjoy using CodeIgniter for a lot of my web development projects but sometimes I do get frustrated at the lack of simple things such as chaining especially with the email library. Not to mention, I have had a few problems with it on occasion. I recently decided to take a look at what PHP apps or libraries could easily integrate with PHP without so much as having to always write a "CI" library for integration to be successful..
For my first port of call, I immediately thought of Swift Mailer. I did search the web and found a library with tried to integrate Swift Mailer with CodeIgniter but guess what. It was for an old version of CodeIgniter and I felt the version of Swift Mailer used then was pretty old.
This tutorial will show you a very easy way of integrating Swift Mailer into CodeIgniter. The best part is that you do not have to write any library in order to use it. So here goes.
Setup your code application as you normally do. Next download the latest version of Swift Mailer 4.0.6. Create a new folder called swift_mailer in your CI's application/libraries folder and extract the contents of the swift mailer archive into this folder.
Next, using your favourite editor (so loving PHPStorm) create a controller called swiftmail.php in your Controllers folder. You should have a file structure as shown below. Pay no attention to the other files. The main files you need have are outlined as well.