|
发表于 2015-7-23 16:34:29
|
显示全部楼层
//我的代码 你看一下 是成功的
public function email(){
$this->load->library('Email');
//以下设置Email参数
$config ['mailtype'] = 'html';
$config ['charset'] = 'utf-8';
$config ['newline'] = '\r\n';
$config ['protocol'] = 'smtp';
$config ['smtp_host'] = 'smtp.163.com'; //163SMTP服务器地址
$config ['smtp_user'] = 'xc_lemon@163.com'; //邮箱地址
$config ['smtp_pass'] = 'qtmlzameaghefrsq'; //客户端授权码(手机短信)
$config ['mailtype'] = 'html'; //邮件类型
$config ['validate'] = true; //是否验证邮箱地址
$config ['priority'] = 1; //Email 优先级. 1 = 最高. 5 = 最低. 3 = 正常.
$config ['crlf'] = "\r\n"; //换行符
$config ['smtp_port'] = 25; //SMTP端口
$config ['charset'] = 'utf-8'; //gb2312会出现乱码
$config ['wordwrap'] = TRUE; //开启自动换行
$this->email->initialize($config);
//以下设置Email内容
$this->email->from('xc_lemon@163.com', 'xc_lemon'); //发件人email地址和名称
$this->email->to('1327503612@qq.com,xuchen@daoke.me'); //收件人的Email地址
$this->email->subject('Email Test'); //主题
$this->email->message('<font color=blue>哈哈哈哈哈哈哈哈哈哈哈哈</font>'); //内容
//相对于index.php的路径
$this->email->attach('uploads/1_thumb.jpg'); //图片
$this->email->send();
echo $this->email->print_debugger();
} |
|