文件结构:
modules
User
controllers
User
libraries
Email(System Library)
models
views
电子邮件功能:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 587,
'smtp_user' => '******@gmail.com', // change it to yours
'smtp_pass' => '******', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$message = 'Please click given link to activate yout account http://127.0.0.1/heropet/index.php/activate'.$random;
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('info@newseinstein.com'); // change it to yours
$this->email->to($this->input->post('email'));// change it to yours
$this->email->subject('Heropet Account Activation');
$this->email->message($message);
if($this->email->send())
{
echo 1;
}
else
{
echo 2;
}
错误:
Class 'Email' not found in application\libraries\MX\Loader.php on line 166.
请告诉我错误在哪里,以便我可以提前解决我的错误和谢意。我是CodeIgniter HMVC的新手。