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

Email received in a code style not a message type - Codeigniter

只是想知道我在我的 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));
  }

 
}

我收到的是包含代码的电子邮件,而不是普通电子邮件

$this->load->library('email');
$config['mailtype'] = 'html';
$this->email->initialize($config);

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