Tema: PHPmailer
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/11/2006, 12:16
AlejandroT
 
Fecha de Ingreso: noviembre-2006
Ubicación: en la universidad
Mensajes: 15
Antigüedad: 17 años, 6 meses
Puntos: 0
Bueno todavia me sigue dando el mismo error aqui se los pongo para ver si tienen respuesta
Error:E_Warning
fptus():supplied argument is not a valid stream resource at class.smtp.php line 128
aqui esta la clase:
class SMTP
{
var $SMTP_PORT = 25; # the default SMTP PORT
var $CRLF = "\r\n"; # CRLF pair

var $smtp_conn; # the socket to the server
var $error; # error if any on the last call
var $helo_rply; # the reply the server sent to us for HELO

var $do_debug; # the level of debug to perform
function SMTP() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;

$this->do_debug = 0;
}
function Connect($host,$port=0,$tval=30) {
$this->error = null;
if($this->connected()) {
$this->error =
array("error" => "Already connected to a server");
return false;
}

if(empty($port)) {
$port = $this->SMTP_PORT;
}
$this->smtp_conn = fsockopen($host, # the host of the server
$port, # the port to use
$errno, # error number if any
$errstr, # error message if any
$tval); # give up after ? secs
if(empty($this->smtp_conn)) {
$this->error = array("error" => "Failed to connect to server",
"errno" => $errno,
"errstr" => $errstr);
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] .
": $errstr ($errno)" . $this->CRLF;
}
return false;
}
if(substr(PHP_OS, 0, 3) != "WIN")
socket_set_timeout($this->smtp_conn, 1, 0);
$announce = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
}

return true;
}
function Authenticate($username, $password) {
// Start authentication
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);

if($code != 334) {
$this->error =
array("error" => "AUTH not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
return false;
}

// Send encoded username
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);

$rply = $this->get_lines();
$code = substr($rply,0,3);

if($code != 334) {
$this->error =
array("error" => "Username not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] .
": " . $rply . $this->CRLF;
}
return false;
}
el error me lo da en la linea que esta en rojo