• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email received in a code style not a message type - Codeigniter

#1
 I am receiving in my gmail account the code instead of a regular type of message in email. How can I receive the email without the code. Thanks in advance Smile

Controller

Code:
<?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('[email protected]', '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));
  }


}
Reply

#2
Set the email type in your config to html.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.