Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 以代码样式而非消息类型接收的电子邮件-Codeigniter_Php_Codeigniter - Fatal编程技术网

Php 以代码样式而非消息类型接收的电子邮件-Codeigniter

Php 以代码样式而非消息类型接收的电子邮件-Codeigniter,php,codeigniter,Php,Codeigniter,我只是想知道我在gmail账户中收到的是代码,而不是普通的邮件。如果没有代码,我如何接收电子邮件。提前感谢:) 控制器 <?php class account_login_model extends CI_Model { public function __construct() { parent::__construct(); $this->load->database(); } public function login($username

我只是想知道我在gmail账户中收到的是代码,而不是普通的邮件。如果没有代码,我如何接收电子邮件。提前感谢:)

控制器

<?php
class account_login_model extends CI_Model
{
  public function __construct()
  {
    parent::__construct();
    $this->load->database();
  }

  public function login($username, $password)
  {
    $condition_array = array(
      'acc_username' => $username,
      'acc_password' => $password
    );
    $rs = $this->db->get_where('accounts', $condition_array);

    return $rs->row_array() ?: false;
  }

  public function isBlocked($username)
  {
    $condition_array = array(
      'acc_username' => $username,
      'acc_isBlocked' => 1
    );
    $rs = $this->db->get_where('accounts', $condition_array);
    $row_count = count($condition_array);

    if ($row_count > 0) {
      return true;
    } else {
      return FALSE;
    }
  }

  public function block($username)
  {
    $this->load->library('email');

    $email = $this->account_lookup($username, 'acc_email');

    $this->email->from('chicken@chicken.com', 'Student');
    $this->email->to($email);
    $this->email->subject('Account has been blocked');


    $message = $this->load->view('account_blocked', null, TRUE);

    $this->email->message($message);
    $this->email->send();

    $this->db->where('acc_username', $username);
    return $this->db->update('accounts', array('acc_isBlocked' => 1));
  }

 
}


另外,不要忘记发送包含所有必需标记的完整html页面,而不仅仅是子视图。

请将我的答案标记为已接受,以便关闭主题。
$this->load->library('email');
$config['mailtype'] = 'html';
$this->email->initialize($config);