我是 codeigniter 框架的新手。我正在尝试发送电子邮件,但遇到了问题:
调用未定义的方法 CI_Loader::libary()
这是我在控制器上的脚本:
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'=>'[email protected]',
'smtp_pass'=>'thaitealumajang1'
);
$this->load->libary('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]','Tri Wicaksono');
$this->email->to('[email protected]');
$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());
}
}
}
我已经找到答案了。
输入错误$this->load->libary
。
它应该是$this->load->library
-有一个失踪r
的library
字。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句