<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->load->library('email'); //加载CI的email类
//以下设置Email参数
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.163.com';
$config['smtp_user'] = 'fanteathy';
$config['smtp_pass'] = '******';
$config['smtp_port'] = '25';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
//以下设置Email内容
$this->email->from('fanteathy@163.com', 'fanteathy');
$this->email->to('517081935@qq.com');
$this->email->subject('Email Test');
$this->email->message('<font color=red>Testing the email class.</font>');
$this->email->attach('application\controllers\1.jpeg'); //相对于index.php的路径
$this->email->send();
//echo $this->email->print_debugger(); //返回包含邮件内容的字符串,包括EMAIL头和EMAIL正文。用于调试。
}
}
$this->email->initialize($config)
$this->email->send()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有