Email not working in CI

 $this->load->library('email');

$config['protocol']    = 'smtp';
$config['smtp_host']    = 'tls://smtp.mail.net';
$config['smtp_port']    = '465';
$config['smtp_timeout'] = '10';
$config['smtp_user']    = 'apikey';
$config['smtp_pass']    = 'SG..FRzo2eJ4e6kMPH_nadeghjdddjkkDgBOaZwX6NrPYav6eEPHUM7FNpD58';
$config['charset']    = 'utf-8';
$config['newline']    = "\r\n";
$config['mailtype'] = 'html'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not   
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;  

$this->email->initialize($config);

$this->email->from('aditya@soatechnology.net', 'Laughing Adda');
$this->email->to($email); 
$this->email->subject($email_template->title);
$this->email->message($email_template->message);  

$this->email->send();

echo $this->email->print_debugger();

Leave a Reply