Q: Add variables to CodeIgniter email call I have been trying to create variables to parse into the email class for sending mails in codeigniter. Assuming I want to send a mail to the logged in user, I decided to create a variable 
  uemail = $_SESSION['email'];But then when I decided to parse it into the email class as $this->email->to($uemail);, does not send the email to the mail. But then when I use $this->email->to('email@email.com'); the mail is sent to the email correctly so I'm thinking I'm experiencing problem with parsing the variable.  Doing $this->email->to($_SESSION['email']); too does not work. Please help me out. Thank you .
I just updated my question with detailed codes. I hope this helps. See below;
     <?php 
     $this->Sendmails_model->sendmail();
     $uemail = $_SESSION['email'];
     $this->email->to($uemail);
     $this->email->subject('Email subject here'); 
     $maildata = array(
       'firstName' => $_SESSION['first'],
       'content' => 'Email content here'
     );

  $body = $this->load->view('emails/basic',$maildata,TRUE);

  $this->email->message($body);

  $this->email->send();
?>


A: For setting session variables you have to use this syntax,
$this->session->userdata('session_variable');

Looking up the link in @Vickel 's comment, $_SESSION['session_variable'] may also be used in CodeIgniter. Hence no problem with the codes.
From your comment, the issue was with the server receiving the email, hence we may consider this question solved. 
