美文网首页
CI使用163邮箱给QQ邮箱发送邮件

CI使用163邮箱给QQ邮箱发送邮件

作者: lyhwbt | 来源:发表于2018-08-21 00:04 被阅读0次
    $this->load->library('email'); //加载CI的email类
    //以下设置Email参数
    $config['protocol'] = 'smtp';
    $config['smtp_host'] = 'smtp.163.com';
    $config['smtp_user'] = 'user@163.com';//发件人
    $config['smtp_pass'] = 'password';//密码
    $config['smtp_port'] = '25';//端口
    $config['charset'] = 'utf-8';//编码
    $config['validate'] = true;//是否验证邮件地址
    $config['wordwrap'] = TRUE;
    $config['mailtype'] = 'html';//格式
    $this->email->initialize($config);//配置
    //以下设置Email内容
    $this->email->from('user@163.com', 'fanteathy');//(发件人,发件人名称)
    $this->email->to('123456@qq.com');//收件人
    $this->email->subject('Email Test');//标题
    $this->email->message('<font color=red>test email</font>');//内容
    if($this->email->send()){
        echo 'yes';
    }else{
        echo $this->email->print_debugger();
    }
密码为此处设置的密码: 捕获.PNG

相关文章

网友评论

      本文标题:CI使用163邮箱给QQ邮箱发送邮件

      本文链接:https://www.haomeiwen.com/subject/dfgriftx.html