//以下设置Email参数
$this->load->library('Email');
$config['smtp_host'] = 'smtpdm.aliyun.com';
$config['smtp_user'] = 'Xxxxxx .com';
$config['smtp_pass'] = 'xxxxxx';
$config['smtp_port'] = '25';
$config['protocol'] = 'smtp';
$config['charset'] = 'utf-8';
//$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$config['send_multipart'] = FALSE;
$this->email->initialize($config);
//加载CI的email类
//以下设置Email内容
$this->email->from('xxxxxx.com');
$this->email->to('xxxxxxxxxx@qq.com');
$this->email->subject('Email Test');
$this->email->message('<font color=red>Testing the email class.</font>');
$this->email->send();
echo $this->email->print_debugger(); //返回包含邮件内容的字符串,包括EMAIL头和EMAIL正文。用于调试。