Codeigniter - 发送电子邮件

i try to send email with codeigniter on localhost.

In order to that, in config directory i open a new php file called email

and write

<?php

$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => 'mertmetinbjk@gmail.com',
    'smtp_pass' => 'pass',
);
$this->load->library('email', $config);

?>

and in my controller write this

$this->load->library('email');
        $this->email->from('bildirim@pasaj.com','Pasaj.com');
        $this->email->to($email);
        $this->email->subject('pasaj hesabinizi aktive etmek icin');
        $this->email->message('Tıkla');
        $this->email->send();

but i get these errors:

enter image description here

i made some research on the Internet, i read that i have to enable ssl from my php.ini file but there is no line like what can i do ?

TY

try this:

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

instead of this:

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

Your controller would look like this:

$this->load->library('email');
$this->email->from('bildirim@pasaj.com','Pasaj.com');
$this->email->to($email);
$this->email->subject('pasaj hesabinizi aktive etmek icin');
$this->email->message('Tıkla');
$this->email->send();

Perhaps it's a good thing to post the answer you got from the CodeIgniter Forums

Try this;

$email =$this->input->post('email');
$this->load->library('email');
$this->email->from('bildirim@pasaj.com','Pasaj.com');
$this->email->to($email);
$this->email->subject('pasaj hesabinizi aktive etmek icin');
$this->email->message('Tıkla');
$this->email->send();