Wie zu beheben des Fehlers: Fehlermeldung: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused)

Ich bin mit codeigniter erstellte ich eine E-Mail-Funktion zum senden von E-Mails an bestimmte E-Mail-ID

public function email($email){
        $config['protocol'] = 'smtp';
        $config['smtp_host'] = 'ssl://smtp.gmail.com';
        $config['smtp_timeout']=5;
        $config['smtp_port'] = '465';
        $config['smtp_user'] = '[email protected]';
        $config['smtp_pass'] = '********************';
        $config['mailtype'] = 'html';
        $config['charset'] = 'utf-8';
        $config['newline'] = "\r\n";
        $config['wordwrap'] = TRUE;
        $this->load->library('email');
        $this->email->initialize($config);

        $this->email->from('[email protected]', 'MyEmailID');
        $this->email->to($email);
        $this->email->subject('My Subject');
        $this->email->message('My Message');
        return $this->email->send();
    }

Die das arbeiten schön in meiner lokalen Maschine, aber wenn ich hochgeladen, der code hosting-server (ich bin mit Godaddy hosting) ich erhalte folgende Fehlermeldung:

Einen PHP-Fehler aufgetreten

Schweregrad: Warnung

Nachricht: fsockopen(): unable to connect to ssl://smtp.gmail.com:465
(Connection refused)

Mit dem Namen: libraries/Email.php

Linie Nummer: 2020

Backtrace:

Datei: /home/MyDir/public_html/application/models/BasicModel.php
Line: 47 Funktion: senden

Datei: /home/MyDir/public_html/application/controllers/Login.php
Line: 48 Funktion: E-Mail

Datei: /home/MyDir/public_html/index.php Line: 315 Funktion:
require_once

  • versuchen Sie ssl://smtp.googlemail.com
  • obige code funktioniert mit meinem localhost, aber nicht mit meinem hosting 🙁
  • hast du dafür eine Lösung? Gleiche Problem hier :/
Schreibe einen Kommentar