Send email using codeigniter?

In this article I will explain you how to send email using codeigniter.Codeigniter have library for email feature. You just need to autoload that library.Isn’t it very simple?

Codeigniter supported inbuilt Email library class which simplify the email sending process. To send email we need to do some configuration , need to load email library.codeigniter supports Multiple Protocols, Mail, Sendmail, and SMTP, Multiple recipients, CC and BCCs, HTML or Plain text email, Attachments ,Word wrapping and many more feature.So lets start and do some codeing stuff for Send email using codeigniter.
First create a controller in the Controller folder name with Email.php

Now copy and paste the following code

 defined('BASEPATH') OR exit('No direct script access allowed');
 class Email extends CI_Controller {
 public function __construct() {
 public function sendEmail(){
    //now copy and paste the below code
    $html = "Test email";
     $email_setting = array('mailtype'=>'html');
     $this->email->to('the email address');
     $this->email->subject('Title': 'New email');
Now Run the sendEmail function.

Hope this article will help You. Keep reading.