Ich bekomme immer diesen Fehler:
Fatal error: Using $this when not in object context in /htdocs/xxxx/xxx/xxxxx/includes/class.inc on line 78
Auf einem Testserver hat es funktioniert.
Jetzt will es nicht mehr. Woran kann es liegen?
PHP-Code:
function &connect($params = array()){
if(!isset($this->status)){
$obj = new smtp($params);
if($obj->connect()){
$obj->status = SMTP_STATUS_CONNECTED;
}
return $obj;
}else{
$this->connection = fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout);
if(function_exists('socket_set_timeout')){
@socket_set_timeout($this->connection, 5, 0);
}
$greeting = $this->get_data();
if(is_resource($this->connection)){
return $this->auth ? $this->ehlo() : $this->helo();
}else{
$this->errors[] = 'Failed to connect to server: '.$errstr;
return FALSE;
}
}
}