CI发送到邮箱功能(支持发送附件)
来源:互联网 发布:档案管理源码 编辑:程序博客网 时间:2024/06/10 04:21
public function sendMail() {
$config['protocol'] = 'smtp';//采用smtp方式
$config['smtp_host'] = 'smtp.126.com';
$config['smtp_user'] = 'mytest@126.com';//你的邮箱帐号
$config['smtp_pass'] = 'mytest123';//你的邮箱密码
//$config['smtp_pass'] = 25;
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->load->library('email');//加载email类
$this->email->initialize($config);//参数配置
$this->email->from('lijunhua19862008@126.com', '我是发件人 陈立伟');
$this->email->to('my@test.com');
//$this->email->cc('another@another-example.com');
//$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test to guijia');
if(!$this->email->send()){
$data="<font color='red' size='10px'>邮件发送失败,可能是由您的发件人或者密码填写不匹配造成</font>";
} else {
$data="<font color='red' size='10px'>邮件发送成功</font>";
}
echo $data;
echo $this->email->print_debugger();
}
$config['protocol'] = 'smtp';//采用smtp方式
$config['smtp_host'] = 'smtp.126.com';
$config['smtp_user'] = 'mytest@126.com';//你的邮箱帐号
$config['smtp_pass'] = 'mytest123';//你的邮箱密码
//$config['smtp_pass'] = 25;
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->load->library('email');//加载email类
$this->email->initialize($config);//参数配置
$this->email->from('lijunhua19862008@126.com', '我是发件人 陈立伟');
$this->email->to('my@test.com');
//$this->email->cc('another@another-example.com');
//$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test to guijia');
$this->email->message('Testing the email class.');
$this->email->attach('static/upfile/'.$sfile.'');
if(!$this->email->send()){
$data="<font color='red' size='10px'>邮件发送失败,可能是由您的发件人或者密码填写不匹配造成</font>";
} else {
$data="<font color='red' size='10px'>邮件发送成功</font>";
}
echo $data;
echo $this->email->print_debugger();
}
- CI发送到邮箱功能(支持发送附件)
- CI发送到邮箱功能(支持发送附件)
- C#邮箱、附件发送
- asp.net 发送邮件 支持 163 发送到常见邮箱
- 带附件的邮箱发送
- Android发送邮件到指定邮箱(可带附件)
- 发送到邮箱
- SpringBoot,发送到邮箱
- CI框架中163邮箱发送邮件
- CI框架中QQ邮箱发送邮件
- python smtp QQ邮箱 发送附件
- 邮箱发送类支持群发
- C#写的邮箱发送程序源代码---支持主题、正文、附件的编辑和添加!
- JAVA自动生成sql结果到excel,并以附件方式发送到指定邮箱
- net的发送邮箱功能
- java实现邮箱发送功能
- wordpress配置邮箱发送功能
- javamail模拟邮箱功能发送电子邮件-中级实战篇【新增附件发送方法】(javamail API电子邮件实例)
- SecureCRT_ha的使用
- 黑马程序员---泛型list
- 敲回车键进行System打印语句
- 1251 hdu 字典树
- NY--290 -- 动物统计加强版 [字典树最简化应用]
- CI发送到邮箱功能(支持发送附件)
- git 把远程分支拿到本地,并建立关联关系track
- mysql实现允许外部ip访问
- Hibernate的JavaBean属性名称大小写的一个Bug
- java学习1
- wpf线程模型
- 【Android】loadData与loadDataWithBaseURL的区别
- 学习python(八)
- 异常:SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];