我是PHP的新手,所以我很困惑看到这些不同的运营商整天.这是我在观看视频tutorail时遇到的一些代码,如果有人可以解释一下,我会很感激:
class Email extends CI_Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'username@gmail.com',
'smtp_pass' =>'password',
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('username@gmail.com', 'Jerry');
$this->email->to('username@gmail.com');
$this->email->subject('this is an email test');
$this->email->message('this is test message!');
if($this->email->send())
{
echo 'Your email was sent';
}
else
{
show_error($this->email->print_debugger());
}
}
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
505 次 |
| 最近记录: |