Skip to content

Instantly share code, notes, and snippets.

@abelorian
Created September 12, 2014 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abelorian/0d5190c162092665a5c5 to your computer and use it in GitHub Desktop.
Save abelorian/0d5190c162092665a5c5 to your computer and use it in GitHub Desktop.
Enviar email con Codeigniter
public function enviar_correo_codeigniter($email, $asunto, $contenido){
// Email configuration
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.tuhost.cl',
'smtp_port' => 465,
'smtp_user' => 'TUCORREO', // change it to yours
'smtp_pass' => 'TUPASS', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->from('TUCORREO', "Admin Team");
$this->email->to($email);
$this->email->subject($asunto);
$this->email->message($contenido);
$data['message'] = "Sorry Unable to send email...";
if ($this->email->send()) {
$data['message'] = "Mail sent...";
echo "enviado";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment