I am new in codeigniter framework. I'm trying to send email but I have the problem:
Call to undefined method CI_Loader::libary()
here is my script on controller :
class Email extends CI_Controller{
function __construct()
{
parent::__construct();
}
function index()
{
$config = array(
'protocol' => 'smtp',
'smtp_host'=>'ss://smtp.googlemail.com',
'smtp_port'=>465,
'smtp_user'=>'thaitea.lumajang@gmail.com',
'smtp_pass'=>'thaitealumajang1'
);
$this->load->libary('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('thaitea.lumajang@gmail.com','Tri Wicaksono');
$this->email->to('cha8agust@gmail.com');
$this->email->subject('This is an email test');
$this->email->message('It is working bro');
if($this->email->send())
{
echo 'Your email send';
} else {
show_error($this->email->print_debbuger());
}
}
}
I already find out the answer.
There is wrong typing in $this->load->libary
.
It should be $this->load->library
- there is a missing r
in library
word.