Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Code Igniter whats wrong with my code [closed]
  2. class Email extends CI_Controller{
  3.  
  4. function __construct(){
  5.  
  6.     parent::CI_Controller();
  7. }
  8.  
  9. function index(){
  10.  
  11.     $config = Array(
  12.     'protocol' => 'smtp',
  13.     'smtp_host' => 'ssl://smtp.googlemail.com',
  14.     'smtp_port' => 465,
  15.     'smtp_user' => 'xxx',
  16.     'smtp_pass' => 'xxx'
  17.     );
  18.  
  19.     $this->load->library('email', $config);
  20.     $this->email->set_newline("rn");
  21.  
  22.     $this->email->from('xxx', 'name');
  23.     $this->email->to('xxx');
  24.     $this->email->subject('EMAIL TEST');
  25.     $this->email->message('Its working...');
  26.  
  27.     if($this->email->send()){
  28.  
  29.         echo 'Successfully sent.';
  30.  
  31.     }
  32.     else{show_error($this->email->print_debugger())}
  33. }  
  34.  
  35. }
  36.        
  37. else{
  38.      show_error($this->email->print_debugger());
  39. }