Advertisement
Guest User

Untitled

a guest
Oct 29th, 2017
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. public function enviar(){
  2.  
  3.  
  4.         $config = Array(
  5.           'protocol' => 'smtp',
  6.           'smtp_host' => 'ssl://smtp.googlemail.com',
  7.           'smtp_port' => 465,
  8.           'smtp_user' => 'sebastian.hondarza@gmail.com',
  9.           'smtp_pass' => 'programador.1994',
  10.           'mailtype' => 'html',
  11.           'charset' => 'utf-8',
  12.           'newline' => "\r\n",
  13.           'wordwrap' => TRUE
  14.         );
  15.  
  16.  
  17.         $this->load->library("email");
  18.         $this->email->initialize($config);
  19.         $this->email->set_newline("\r\n");
  20.         $this->email->from('sebastian.hondarza@gmail.com'); // change it to yours
  21.         $this->email->to('sebastian.hondarza@gmail.com'); // change it to yours
  22.         $this->email->subject('Email using Gmail.');
  23.         $this->email->message('Working fine ! !');
  24.  
  25.         if($this->email->send()){
  26.             echo 'Envio correcto!';
  27.         }else{
  28.             show_error($this->email->print_debugger());
  29.         }
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement