<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mail extends CI_Controller {

  public function __construct() {
    parent::__construct();
    
    if (empty($_SESSION['usuario'])) {
      redirect('login');
    }

    // Load form helper library
    //$this->load->helper('form');

    // Load form validation library
    //$this->load->library('email');

    // Load database
    //$this->load->model('Message_model', 'Message', true);
    $this->load->model('Producto_model', 'Producto', true);
  }

  /**
   * Muestra formulario para enviar mensaje al administrador
   */
  public function index() {
    $this->load->library('email');
    $this->email->from('contacto@dementegames.cl', 'DeMente Games');
    $this->email->to('feldorx@gmail.com');
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
    $this->email->send();
  }
}