Codeigniter 2.20 – Sending E-mail using codeigniter

Back to CodeIgniter Tutorials

In CodeIgniter, sending e-mail is a simple process. First the library is loaded. Then the user provides e-mail related data. Finally, the E-mail is sent. Here is how E-mail is sent using a Controller in CodeIgniter

  1. Load the E-mail library of CodeIgniter
  2. Provide set of characters that are to be permitted in the E-mail address.
  3. Initialize the type of e-mail as html (options text or html)
  4. Provide Sender’s E-mail address
  5. Provide Receiver’s E-mail Address
  6. Provide BCC E-mail address
  7. Provide Subject of the E-mail
  8. Provide Body of the E-mail.
  9. Send the E-mail!

Following is the complete code of the above process.

Let me know in comments if there is something that you would like to know. And do like an share.

Back to CodeIgniter Tutorials

Laravel Tutorial 1 : Installation in XAMPP

Lets get it straight. “You want to install Laravel”. With this tutorial, I am starting a Laravel series. My tutorials are short and to the point. So lets get started without any fuss.


  1. Download Composer or visit their official website.
    • Select “Install Shell Menus” in setup as shown.

      composerInstallation  install shell menu
      install shell menu
    • Press Next and point the setup to  the php.exe. For example, in my case, it is
  2. Download Git
  3. Download Laravel Installaion Files from Github

Now that you have downloaded and installed Composer and Git, you can now start the Laravel installation process.

Installation of Laravel

  1. Extract Laravel to the xampp/htdocs folder. These are the installation files.
  2. Right click on the extracted folder and select Use Composer here. (this is why you installed shell menu with composer)
  3. A command prompt will open with composer settings. Also note that you will be at your extracted Laravel install
  4. Type the following command and press Enter. Downloading of Laravel assets will start.


Laravel is now installed. Now we will create a project.

Create a Project

  1. Go to Run and type cmd. 
  2. Lets assume that the project we are making is called “codeonion“.
  3. Type the following command in cmd to make out project:
  4. Wait for installation to finish.

A project named “codeonion” is made from Laravel installation. Lets test it.

Testing of new project

  1. Open your browser.
  2. Go to the following link
  3. If you see the following then the installation went ok

That is it! Laravel has been installed. In the coming tutorials, I will explain configuration of Laravel and then a project will be made.

Codeigniter 2.20 – How to manage assets (js, jpg etc) (using View)

Back to CodeIgniter Tutorials

In this guide, you will learn to use CSS and JS files by calling them from the VIEW (not the controller). In the coming lessons, I will also write on importing assets using Controller but here, we are using views.

  • First, install Codeigniter using the method as described here.
  • Then make your own homepage using the method explained here.

Now that we are set up, lets get started!

  1. Go to your Codeigniter folder and add a folder called assets such that it should look like this yourwebsite/assets/ For reference, look at the following

    codeigniter assets folder
    codeigniter assets folder
  2. Inside /assets/ create three folders which should look like this
    1. CSS folder named css
    2. Javascript folder named javascript 
  3. In the css folder, create style.css
  4. In the javascript folder, create scripts.js
  5. Go to your homepage and paste the following in the <head> tag.

  6. That is all. You can similarly add jquery and images in the same fashion. In order to confirm that the CSS and javascript is loaded, you can check source of the loaded page and click on the .css and .js files

Please note that this guide is applicable on using XAMPP. For web server, you may have different folder paths for example:

I hope you find this tutorial informational. Do not forget to comment and share 🙂

Back to CodeIgniter Tutorials