Skip to content

Instantly share code, notes, and snippets.

@robertopc
Last active August 29, 2015 14:27
Show Gist options
  • Save robertopc/d37badd16f7e98e441de to your computer and use it in GitHub Desktop.
Save robertopc/d37badd16f7e98e441de to your computer and use it in GitHub Desktop.
Envio de email com Gmail no CodeIgniter
<?php
$this->load->library('email');
$this->email->initialize(array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => '465',
'smtp_timeout' => '60',
'smtp_user' => '{{{email gmail}}}',
'smtp_pass' => '{{{senha gmail}}}',
'charset' => 'utf-8',
'newline' => "\r\n"
));
$this->email->from('{{{remetente}}}', '{{{nome remetente}}}');
$this->email->to('{{{destinatario}}}');
$this->email->subject('{{{assunto}}}');
$this->email->message('{{{mensagem}}}');
$this->email->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment