|
错误为 lang:email_no_from
什么意思啊
我还是贴一下下代码吧
class Email extends CI_Controller
{
function __construct()
{
parent::__construct();
header("Content-type: text/html; charset=utf-8");
date_default_timezone_set('Asia/Shanghai');
}
public function index()
{
$this->load->library('email'); //加载CI的email类
//以下设置Email参数
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.163.com';
$config['smtp_user'] = '13*****83@163.com';
$config['smtp_pass'] = '******';
$config['smtp_port'] = '25';
$config['smtp_timeout'] = 10;
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'text';
$this->email->initialize($config);
//以下设置Email内容
$this->email->from('13******83@163.com', '王婷婷');
$this->email->to('*******@qq.com');
$this->email->subject('哈哈哈哈哈');
$this->email->message('嘻嘻嘻嘻嘻嘻嘻');
$this->email->send();
if($this->email->send()==1){
echo "邮件发送成功,请到邮箱验证"."<br />";
}else{
echo "邮件发送失败,请重新发送"."<br />";
echo $this->email->print_debugger();
}
}
}
|
|