fsockopen errors with SSL

Asked

Viewed 22 times

0

Well I have a code that in wamp server php 7.3.1 always works. When I went up to a hundred running CWP7 php 7.3.2 the same code doesn’t work

$config['Protocol'] = "smtp";

    $config['smtp_host'] = "ssl://smtp.gmail.com";
    $config['smtp_port'] = "465";
    $config['smtp_user'] = "[email protected]";
    $config['smtp_pass'] = "xxxxx";
    $config['charset'] = "utf-8";
    $config['mailtype'] = "html";
    $config['newline'] = "\r\n";




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

    $this->ci->email->initialize($config);        
    $this->ci->email->to($email);
    $this->ci->email->message($messagem);


    $this->ci->email->bcc("xxxx");
    $this->ci->email->from('xxxx', 'xxxx');
    $this->ci->email->subject($titulo);
    $res = $this->ci->email->send();
    echo $this->ci->email->print_debugger();

There loose is error message:

Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Network is unreachable)

In CWP you have according to php the openssl module is there. inserir a descrição da imagem aqui

J [I looked for several solutions and found no... Does anyone have any idea what I can try?

1 answer

0

I ended up finding the reason as I had enabled the firewall ports 465 and 587 were blocked so I went to the CWP firewall and enabled the exit traffic through ports 465 and 587. Before it was only allowed entrance traffic by them.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.