Welcome Guest, Not a member yet? Register   Sign In
[solved]Can't send email in CI 2.0
#1

[eluser]Unknown[/eluser]
this is the code:

Code:
<?php

class Email extends CI_Controller{
    function Email()
    {
        parent::__construct();
    }

    function index(){
        $config = Array(
           'protocol' => 'smtp',
            'smtp_host' => 'ssl://smtp.googlemail.com',
            'smtp_port' => 465,
            'smtp_user' => '***@***.com',
            'smtp_pass' => '*****',
            'mailtype'  => 'html',
            'charset'   => 'iso-8859-1'
        );

        $this->load->library('email', $config);
        $this->email->set_newline("\r\n");

        $this->email->from('***@***.com', '*****');
        $this->email->to('***@***.com');
        $this->email->subject('subject');
        $this->email->message('message');

      
        if($this->email->send())
        {
            echo 'your email was sent, fool';
        }
        else {
        show_error($this->email->print_debugger());
        }
   }

}

and give this error:

Code:
A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

Filename: libraries/Email.php

Line Number: 1673
A PHP Error was encountered

Severity: Warning


Please help me.. :-S
#2

[eluser]Unknown[/eluser]
solved,

1. open your php.ini configuration on wamp
2. uncoment extension=php_openssl.dll
3. restart your wamp

and it's working great.. thank you.




Theme © iAndrew 2016 - Forum software by © MyBB