Created
September 12, 2014 18:17
-
-
Save abelorian/0d5190c162092665a5c5 to your computer and use it in GitHub Desktop.
Enviar email con Codeigniter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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