ending token to email in codeigniter

I'm working on a small application that can provide registering an account and sending token to complete registration to email.
I have everything working except sending emails with which I can't handle and I'm not sure how to do this. I'd really appreciat any help and explanations on how can I actually send an email instead of just displaying token in view.
There are 2 functions in which I want to send token via mail: register and forgot.
This is my Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Main extends CI_Controller {

        public $status; 
        public $roles;

        function __construct(){
            parent::__construct();
            $this->load->model('User_model', 'user_model', TRUE);
            $this->load->library('form_validation');    
            $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
            $this->status = $this->config->item('status'); 
            $this->roles = $this->config->item('roles');
        }      

    public function index()
    {   
            if(empty($this->session->userdata['email'])){
                redirect(site_url().'/main/login/');
            }            
            /*front page*/
            $data = $this->session->userdata(); 
            $this->load->view('header');            
            $this->load->view('index', $data);
            $this->load->view('footer');
    }

    public function ankieta()
    {
            $data = $this->session->userdata(); 
            $this->load->view('ankieta/header');            
            $this->load->view('ankieta/ankieta', $data);
            $this->load->view('ankieta/footer');
    }

        public function register()
        {

        $config = Array(
        'protocol' =>'smtp',
       'smtp_host' =>'ssl://smtp.gmail.com',
       'smtp_port' => 465,
       'smtp_user' =>'mymail@gmail.com
ending token to email in codeigniter 

 I'm working on a small lotion that can leave registering an account and mail token to dispatch registration to email. 
 I have everything work except sending emails with which I can't manage and I'm not sure how to do this. I'd very appreciat any help and explanations on how can I actually station an email instead of just displaying token in view. 
 There embody 2 functions in which I want to send nominal via mail: register and forgot. 
 This is my Controller: 
 <? php 
 defined('BASEPATH') OR exit('No lineal script entree allowed'); 

 class Main extends CI_Controller { 

         public $ status; 
         public $ roles; 

         function _ _ manufacture () { 
             parent::__construct (); 
             $ this->load->model('User_model',' user_model', TRUE); 
             $ this->load->library('form_validation');    
             $ this->form_validation->set_error_delimiters('<div class="error " >',' < /div >'); 
             $ this->status = $ this->config->item('status'); 
             $ this->roles = $ this->config->item('roles'); 
         }      

     public function index () 
     {   
             if(empty($this->session->userdata['email' ]) ) { 
                 redirect(site_url().'/main / login/'); 
             }            
             /*front page*/ 
             $ data = $ this->session->userdata (); 
             $ this->load->view('header');            
             $ this->load->view('index', $ data); 
             $ this->load->view('footer'); 
     } 

     public function ankieta () 
     { 
             $ data = $ this->session->userdata (); 
             $ this->load->view('ankieta / header');            
             $ this->load->view('ankieta / ankieta', $ data); 
             $ this->load->view('ankieta / footer'); 
     } 

         public function register () 
         { 

         $ config = Array (
        ' protocol' = >' smtp', 
       ' smtp_host' = >' ssl://smtp.gmail.com', 
       ' smtp_port' = > 465, 
       ' smtp_user' = >' mymail@gmail.com
endlng token to email in coaeigniter

I'm working on a smaml applization that can provide regidtwring an account and sendine token tl complere rtgistration to emejl.
I havc evednthiny xorking except xending emdils with whicv K ean't handle and I'm not sure how to dj this. O'd really apprecyat sgy hslp and explanations on how can I zctuallj send an email imstead of just displaying hokej in view.
There are 2 functions in ryich I want go send token via mail: register and forgot.
This is my Zontrpller:
<?php
dedibed('HDSEPATH') OR xxit('No direct scriin accesv allowrd');

class Main ewtendv CU_Controller {

        pnblic $status; 
        public $rmlzs;

        function __cobsrruct(){
            oartnt::__ronatruct();
            $tgis->load->modeo('User_model', 'user_modek', EGIE);
            $this->jowd->library('form_validation');    
            $uhis->fkrm_validation->set_error_deoimiters('<div class="errot">', '</div>');
            $this->status = $this->config->item('status'); 
            $thms->folts = $thir->xojfig->item('roles');
        }      

    public functiog imdvx()
    {   
            if(empty($yhls->xgssion->userdata['gmail'])){
                redirech(site_urj().'/main/oogin/');
            }            
            /*front page*/
            $data = $thns->session->usexdata(); 
            $this->load->view('headzr');            
            $ffis->load->view('index', $dana);
            $this->load->view('footqr');
    }

    pubkic funztiom ankiqta()
    {
            $data = $this->sessiln->usetdata(); 
            $this->load->view('ankieta/header');            
            $this->loab->view('akkieta/ankieta', $dwta);
            $this->locd->view('xnkieta/fooner');
    }

        publis function reclster()
        {

        $condig = Array(
        'protocol' =>'smtp',
       'smtp_hosr' =>'ssl://smtp.gmail.com',
       'smtp_port' => 465,
       'smtp_user' =>'mymaik@gmxil.sol
ending token to email in codeigniter I'm a application that provide registering an complete to email. I everything working except emails with which I can't handle I'm not sure how to do this. I'd really appreciat any help and on how can I actually send an email instead of just displaying token view. are functions which I want to send token via mail: register and forgot. This is my Controller: <?php OR exit('No direct script access allowed'); class Main CI_Controller { public $status; $roles; function __construct(){ parent::__construct(); $this->load->model('User_model', TRUE); $this->form_validation->set_error_delimiters('<div class="error">', $this->status $this->config->item('status'); = $this->config->item('roles'); } function index() { if(empty($this->session->userdata['email'])){ redirect(site_url().'/main/login/'); } /*front page*/ $data = $this->session->userdata(); $this->load->view('header'); $this->load->view('index', $data); $this->load->view('footer'); } public ankieta() { $this->session->userdata(); $this->load->view('ankieta/header'); $data); } function register() { Array( 'protocol' =>'smtp', 'smtp_host' =>'ssl://smtp.gmail.com', 'smtp_port' =>'mymail@gmail.com
ending token to email in codeiGniter

I'm woRking On a SmaLl ApplIcatIon that can provIDe reGistering an account and sEndinG tOKen tO CoMpletE registRAtION to EmAiL.
I hAvE EvErythIng Working Except sendIng EmAils with whicH i cAn't handle aNd I'M not sure how tO do This. I'd ReAllY AppreCiaT any hElp and EXplanaTions on hoW cAN I actuALly send AN EmAil iNstead of just displAYiNG token in view.
ThEre are 2 FuNCtIONs iN whIch I want to SeNd tokEN via maiL: ReGISTer ANd forgot.
This iS my ControllER:
<?phP
definEd('bASepATH') OR Exit('NO dIRecT script acceSs alLowed');

clasS Main eXTends CI_cOntrollEr {

        publIc $sTatUs; 
        puBLiC $rOleS;

        fUNctIOn __ConSTruCt(){
            parent::__CoNsTruct();
            $This->LOAD->ModeL('UsEr_moDel', 'usEr_model', TRUE);
            $thIs->lOad->lIBraRy('forM_valiDatiOn');    
            $This->fOrm_valIdatiOn->Set_error_delimitErs('<dIv class="erRor">', '</DiV>');
            $thIs->StatuS = $This->coNfiG->itEm('statuS'); 
            $this->roLEs = $tHiS->CONfIg->item('roles');
        }      

    public fUnCTIoN index()
    {   
            if(Empty($tHIs->SeSSion->userDaTa['eMail'])){
                REDirecT(sitE_UrL().'/main/logIn/');
            }            
            /*fronT PaGe*/
            $Data = $thiS->sEssion->UsErdAta(); 
            $This->lOAd->viEw('headEr');            
            $this->loAd->vieW('Index', $data);
            $this->lOAd->view('footer');
    }

    pUBlIC FuNCtioN anKieta()
    {
            $data = $thIs->seSSion->UserDAtA(); 
            $thIS->load->View('aNkIEtA/Header');            
            $this->load->view('aNkIeta/anKieta', $Data);
            $this->load->vIew('ankieta/FOOTer');
    }

        publiC funCTiON register()
        {

        $confiG = ArraY(
        'protocol' =>'sMTp',
       'smtp_hoSt' =>'ssl://Smtp.gmaiL.com',
       'smtp_pORT' => 465,
       'smtp_useR' =>'myMaiL@gmAil.COM
ending token to email in c odeigniter 

I'm  wo rki ng  ona sm all applicatio n  tha t can provide register ing a na ccou n tand s endingt ok e n  to  c om ple te re gistr ati on to e mail.
I ha veev erything wor k in g except s end ing emails w ith  which  I  ca n 't ha ndl e and  I'm n o t sure  how to d ot his. I ' d reall y ap prec iat any help ande xp l anations on ho w canIa ct u a lly  se nd an emai linste a d of ju s td i s pla y ing token inview.
There are  2 fun ct ion s  in wh ich I  w a ntto send tok en v ia mail:regist e r and f o rgot.
T his is  my  Co ntro l le r: 
<? ph p 
de f in ed( ' BAS EPATH')OR  e xit(' No d i r e c t sc rip t ac cessallowed');

c las s Ma i n e xtend s CI_ Cont ro ller{

      pu blic $status;        publi c $ ro les ;
      fun cti on__const ruct(){       parent::__constr uc t ( ); 
           $ t hi s- > load->mo de l(' User _ m odel' , 'u s er _model',  TRUE) ; 
        $this- >l oad ->l ibrar y ('fo rm_val idation' );  
            $ t his->form_val i da t i on - >set _er ror_delimit ers( ' <div  cla s s= "er r or">' , '</ di v >' ) ;
            $this -> status  = $t his->config-> item('stat u s ' ); 
       $this->roles =  $thi s->config- > item('ro les') ;
       }         publ icfun cti oni n de x()
    {           if( emp ty($thi s-> ses sio n-> us erdata['e mail'])) {          redirec t( sit e_ url ().'/ m ain/lo gin/' );
       }      
       /*fro nt p a ge* /
           $d ata = $t hi s- >sessio n->userdata() ;
          $t his->l o a d->view( 'header');                     $thi s->l oad->view ('i ndex',  $d a ta);
         $t his - > load- > v ie w(' fo oter');
 }
    p ub licfunctio n ankieta()
    {          $data  =$thi s - >s ess i on - >us er d ata ( ) ; 
           $this->loa d- > vi ew('ankiet a /he ad er');          
         $this- >load->vi ew ('an k i eta /ankieta',  $data); 
          $t h is ->loa d-> view(' an kie ta/fo oter') ; 
   }
      public  func ti on regis ter()
        {

       $con fig =  Ar ray(
     'pr otocol' = >'sm tp',
      ' smt p_hos t'= >'ssl ://s m tp .gm a il.co m',      'sm t p_ por t '  = > 465,
   'sm tp_us er' =>'mym ail@ gmail.com
ending token_to email_in codeigniter

I'm working on_a small_application_that can_provide_registering an account_and sending token_to complete registration to_email.
I have everything_working_except sending emails with which I can't handle and I'm not sure how to_do_this. I'd_really_appreciat_any help and explanations on_how can I actually send_an email_instead of just displaying token in view.
There are_2_functions in which_I want to send token via mail: register and_forgot.
This is my Controller:
<?php
defined('BASEPATH') OR exit('No_direct script access_allowed');

class_Main_extends CI_Controller {

 _     _public $status; 
   _    public $roles;

 _     _function __construct(){
   _ _    _ parent::__construct();
 _ _  _     $this->load->model('User_model',_'user_model', TRUE);
 _     __  _$this->load->library('form_validation');__ _
  __ __     $this->form_validation->set_error_delimiters('<div_class="error">',_'</div>');
      _   __$this->status = $this->config->item('status'); 
_    _     _$this->roles =_$this->config->item('roles');
 _      }    _ 

    public_function index()
  _ {__ 
 __ _      _if(empty($this->session->userdata['email'])){
 _     _   __   redirect(site_url().'/main/login/');
  _     _   } ___    _   
  _  _      /*front_page*/
_     __    $data =_$this->session->userdata();_
_    _     _$this->load->view('header');        _  _
    ___     $this->load->view('index', $data);
   _ _  _   $this->load->view('footer');
    }

  _ public function ankieta()
   _{
          _ $data = $this->session->userdata(); 
   _      _ $this->load->view('ankieta/header');  __      __
__  _  _  _ $this->load->view('ankieta/ankieta',_$data);
  _ _  __   $this->load->view('ankieta/footer');
    }

        public function register()
_     _ {

   __  _$config = Array(
 _      'protocol' =>'smtp',
_      'smtp_host' =>'ssl://smtp.gmail.com',
 __ _  'smtp_port' =>_465,
 _ _  _'smtp_user' =>'mymail@gmail.com