CodeIgniter Forums
$this->load->library('email') version codeigniter 3.1.10, - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: $this->load->library('email') version codeigniter 3.1.10, (/showthread.php?tid=72935)



$this->load->library('email') version codeigniter 3.1.10, - davidR - 03-04-2019

i have this problem, when I add this code:

$configEmail = array(

'protocol' => 'mail',
'smtp_host' => 'mail.**********.com',
'smtp_port' => 25,
'smtp_user' => 'no_repley@*******.com',
'smtp_pass' => *******,
'mailtype' => 'html',
'charset' => 'utf-8',
'newline' => "\r\n"

); 

$this->email->initialize($configEmail);
$this->email->from('no_repley@*******.com', '****.');
$this->email->to('**********@*******.com');
$this->email->subject('hi');
$this->email->message('Saludos');


the server sends me the next warning

"Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request."


The problem is my code or I have to do something on the server?

formerly, after the problem I use 

$this->email->send()

and helping me to solve the problem.

thanks and regards


RE: $this->load->library('email') version codeigniter 3.1.10, - kokero - 03-04-2019

Try changing the 'protocol' => 'mail' to 'protocol' => 'smtp' and also try to verify that the smtp server host is correct.
It may also be that you are informing the host of an SSL connection. If you want this type of connection use 'smtp_crypto' => 'ssl' and 'smtp_port' => 'matching port'.



RE: $this->load->library('email') version codeigniter 3.1.10, - php_rocs - 03-04-2019

@davidR,

You might want to see if mail works on your server (check with the hosting company) and if PHP is correctly configured to send mail (PHP ini).