<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    class Email extends CI_Controller
    {

    function send()
    {
    // Loads the email library
    $this->load->library('email');
    // FCPATH refers to the CodeIgniter install directory
    // Specifying a file to be attached with the email
    // if u wish attach a file uncomment the script bellow:
    //$file = FCPATH . 'yourfilename.txt';
    // Defines the email details
    $this->email->from('some@of.mailaddress', 'ur Name');
    $this->email->to('email@detiny.your');
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
    //also this script
    //$this->email->attach($file);
    // The email->send() statement will return a true or false
    // If true, the email will be sent
    if ($this->email->send()) {
    echo "you are luck!";
    } else {
    echo $this->email->print_debugger();
    }
    }

    }
    ?>