$this->load->library('email');
$config['protocol'] = 'smtp';
//Send to QQ users. To display Chinese, use 'iso-8859-1'
$config['charset'] = 'iso-8859-1';
//Send to user 163. To display Chinese, use 'gb2312'
//$config['charset'] = 'gb2312';
$config['mailpath'] = 'news/index';
$config['smtp_host'] = 'smtp.163.com';
$config['smtp_user'] = 'example0624@163.com';
$config['smtp_pass'] = 'password';
$this->email->initialize($config);
$this->email->from('example0624@163.com', 'example');
$this->email->to('tosombody@qq.com');
//Set CC www.2cto.com
//$this->email->cc();
//Set up secret delivery
//$this->email->bcc();
$this->email->subject("The test of CodeIgniter's sending mail");
$this->email->message('Hello, this is my test program. Please do not reply to the email sent successfully through CodeIgniter.');
//The path needs to use an absolute path
$this->email->attach('D:/QCallServer/htdocs/CI/public/images/google.jpg');
if ($this->email->send()) {
echo 'success...';
} else {
echo 'failed...';
}