File: /var/www/gestor-horarios.bradford/app/helpers/email_helper.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function enviar_correo($data)
{
//$data['para'] = '';
$data['remitente'] = "";
$data['usuario'] = "Grupo automata";
$CI =& get_instance();
$config['mailtype'] = 'html';
$CI->load->library('email', $config);
if(!empty($data['attach']))
{
foreach ($data['attach'] as $key => $value)
{
$CI->email->attach($value);
}
}
$CI->email->to($data['para']);
$CI->email->from($data['remitente'], $data['usuario']);
$CI->email->bcc($data['remitente']);
$CI->email->subject($data['asunto']);
$CI->email->message($data['mensaje']);
$CI->email->send();
echo $CI->email->print_debugger();
}