CI框架是个优秀的PHP框架,本博客将不断更新CI框架的一些代码段,供自己后续回顾~
public function email(){
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['smtp_host'] = ''; //如smtp.sohu.com
$config['smtp_user'] = ''; //邮箱
$config['smtp_pass'] = ''; //邮箱密码
$config['mailtype'] = 'html';
$config['validate'] = true;
$config['priority'] = 1;
$config['crlf'] = "\r\n";
$config['smtp_port'] = 25;
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$this->email->initialize($config);
$this->email->from('', ''); //邮箱名 和 昵称
$this->email->to(''); //收件人
//$this->email->cc('another@another-example.com');
//$this->email->bcc('them@their-example.com');
$this->email->subject('你好啊,这个可以用的哦');
$this->email->message('这是测试!');
$this->email->send();
echo $this->email->print_debugger();
}