Foros del Web » Programando para Internet » PHP »

Problema con la funcion PHPMailer

Estas en el tema de Problema con la funcion PHPMailer en el foro de PHP en Foros del Web. Hola necesito me ayuden porque necesito enviar un correo y uso la clase PHPMailer le adjunto el codigo porfi para que lo revisen y los ...
  #1 (permalink)  
Antiguo 27/03/2009, 13:03
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Hola necesito me ayuden porque necesito enviar un correo y uso la clase PHPMailer le adjunto el codigo porfi para que lo revisen y los errores que me da.Muchas gracias soy una novata les agradeceria su colaboracion ademas es un mensaje sencillo con un pequeño texto fijo .
Código PHP:
 require("C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.phpmailer.php");
    
$mail = new PHPMailer();
    
$mail->PluginDir="C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.php";
    
$mail->Mailer="smtp";
    
//$mail->IsSMTP();
    
$mail->Host "192.168.0.3";
    
$mail->Port="25";
    
$mail->Username "direccion email";
    
$mail->Password "yanuarys";   
    
$mail->SMTPAuth true;
    
$mail->CharSet "UTF-8";
    
$mail->From "direccion mail";
    
$mail->FromName "Reportes Seisa";
    
//$mail->IsHTML(true);
    
$mail->Subject "Nuevo Reporte";
    
$mail->AltBody "Debe visitar el sitio para asignar un nuevo reporte";
    
//$mail->ErrorInfo();
    //$mail->AddEmbeddedImage('logo.gif','my-logo');
    //$mail->AddEmbeddedImage('bg.gif','my-bg');
    /* Destinatarios */
    
$mail->AddAddress('direccion email','Gerencia Informatica');
    if(!
$mail->Send()) {
  echo 
"Mailer Error: " $mail->ErrorInfo;
} else {
  echo 
"Message sent!";


Estos son los errores al oprimir el boton que envia el correo



Código PHP:
WarningPHPMailer::include_once(C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.phpclass.smtp.php) [function.PHPMailer-include-once]: failed to open streamNo such file or directory in C:wampwwwReportesSeisaPaginasphpmailerclass.phpmailer.php on line 520

Warning
PHPMailer::include_once() [function.include]: Failed opening 'C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.phpclass.smtp.php' for inclusion (include_path='.;C:\php5\pear'in C:wampwwwReportesSeisaPaginasphpmailerclass.phpmailer.php on line 520

Fatal error
: Class 'SMTP' not found in C:wampwwwReportesSeisaPaginasphpmailerclass.phpmailer.php on line 588 

Última edición por GatorV; 27/03/2009 a las 15:54
  #2 (permalink)  
Antiguo 27/03/2009, 13:10
Avatar de @ndreX!  
Fecha de Ingreso: abril-2007
Mensajes: 161
Antigüedad: 17 años
Puntos: 4
Respuesta: Problema con la funcion PHPMailer

Elimina esta linea y luego cuentas:

$mail->PluginDir="C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.php";

Saludos.
__________________
Blog de Andres Ortiz: http://www.axpuntes.com/
  #3 (permalink)  
Antiguo 27/03/2009, 14:01
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: Problema con la funcion PHPMailer

Quite esa linea y me salio todo esto que hago

Código PHP:
SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "220 seisa.cu - SMTP Server ESMTP " SMTP -> get_lines(): $data is "220 seisa.cu - SMTP Server ESMTP " SMTP -> FROM SERVER220 seisa.cu SMTP Server ESMTP SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $str is "250-STARTTLS " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS " SMTP -> get_lines(): $str is "250-PIPELINING " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING " SMTP -> get_lines(): $str is "250-8BITMIME " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME " SMTP -> get_lines(): $str is "250-SIZE 2097152 " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 " SMTP -> get_lines(): $str is "250 AUTH LOGIN PLAIN CRAM-MD5 " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 250 AUTH LOGIN PLAIN CRAM-MD5 " SMTP -> FROM SERVER250-seisa.cu SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 250 AUTH LOGIN PLAIN CRAM-MD5 SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 " SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 " SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "235 ok, go ahead (#2.0.0) " SMTP -> get_lines(): $data is "235 ok, go ahead (#2.0.0) " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok " SMTP -> get_lines(): $data is "250 ok " SMTP -> FROM SERVER250 ok SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok " SMTP -> get_lines(): $data is "250 ok " SMTP -> FROM SERVER250 ok SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "354 go ahead " SMTP -> get_lines(): $data is "354 go ahead " SMTP -> FROM SERVER354 go ahead SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok 1238188901 qp 15454 " SMTP -> get_lines(): $data is "250 ok 1238188901 qp 15454 " SMTP -> FROM SERVER250 ok 1238188901 qp 15454 SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "221 seisa.cu - SMTP Server " SMTP -> get_lines(): $data is "221 seisa.cu - SMTP Server " SMTP -> FROM SERVER221 seisa.cu SMTP Server Message sent!
WarningCannot modify header information headers already sent by (output started at C:wampwwwReportesSeisaPaginasphpmailerclass.smtp.php:1027in C:wampwwwReportesSeisaPaginasRegistrarReporte.php on line 57

Fatal error
Cannot redeclare class Reportes in C:wampwwwReportesSeisaPaginasclases.php on line 10 
  #4 (permalink)  
Antiguo 27/03/2009, 14:09
Avatar de @ndreX!  
Fecha de Ingreso: abril-2007
Mensajes: 161
Antigüedad: 17 años
Puntos: 4
Respuesta: Problema con la funcion PHPMailer

Tambien debes de descomentar esta linea:

$mail->IsSMTP();

Por cierto haces algun echo de $mail->ErrorInfo(); por alguna otra parte, puede que eso influya, pero igual trata primero descomentando la linea que te dije.
Saludos.
__________________
Blog de Andres Ortiz: http://www.axpuntes.com/
  #5 (permalink)  
Antiguo 31/03/2009, 08:39
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: Problema con la funcion PHPMailer

Hola logre enviar el correo con esta funcion el viernes y llego todo bien pero hoy sin cambiar nada reintento y no me da error pero no llegan los correos por favor echenme una mano que ya no se que mas revisar
Código PHP:
require("C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.phpmailer.php");
    
$mail = new PHPMailer();
    
//$mail->PluginDir="C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.php";
    
$mail->Mailer="smtp";
    
$mail->IsSMTP();
    
$mail->Host "192.168.0.3";
    
$mail->Port="25";
    
$mail->Username "dir_email";
    
$mail->Password "yanuarys";   
    
$mail->SMTPAuth true;
    
$mail->CharSet "UTF-8";
    
$mail->From "dir_email";
    
$mail->FromName "Reportes Seisa";
    
//$mail->IsHTML(true);
    
$mail->Subject "Nuevo Reporte";
    
$mail->AltBody "Debe visitar el sitio para asignar un nuevo reporte";
    
//$mail->ErrorInfo();
    //$mail->AddEmbeddedImage('logo.gif','my-logo');
    //$mail->AddEmbeddedImage('bg.gif','my-bg');
    /* Destinatarios */
    
$mail->AddAddress("dir_email","Gerencia Informatica"); 
Ademas deseo agradecar a Andrex por toda su ayuda.
  #6 (permalink)  
Antiguo 31/03/2009, 09:11
Avatar de farra  
Fecha de Ingreso: marzo-2008
Ubicación: Aqui estoy
Mensajes: 574
Antigüedad: 16 años, 1 mes
Puntos: 20
Respuesta: Problema con la funcion PHPMailer

proba asi:
require("/ReportesSeisa/Paginas/phpmailer/class.phpmailer.php");
__________________
Firma:
Es mas dificil para el mono entender que el hombre desciende de el....

PD: Siempre doy karma al que me da una buena respuesta... ;0)
  #7 (permalink)  
Antiguo 31/03/2009, 10:07
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Hola ya cambie eso pero nada ya me llego uno pero mas ninguno porque sera no se porque me llego ese y mas ninguno

Por favor ayudenme ya me di cuenta porque me llegaban algunos y otros no, porque debia poner $mail->Send(); para enviar pero ahora me salen estos errores y ademas el de la funcion header saben si es que no puedo enviar ante esa funcion como le hago por favor ahora me llegan pero con estos errores.
Código PHP:
SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "220 seisa.cu - SMTP Server ESMTP " SMTP -> get_lines(): $data is "220 seisa.cu - SMTP Server ESMTP " SMTP -> FROM SERVER220 seisa.cu SMTP Server ESMTP SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server " SMTP -> get_lines(): $str is "250-STARTTLS " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS " SMTP -> get_lines(): $str is "250-PIPELINING " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING " SMTP -> get_lines(): $str is "250-8BITMIME " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME " SMTP -> get_lines(): $str is "250-SIZE 2097152 " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 " SMTP -> get_lines(): $data was "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 " SMTP -> get_lines(): $str is "250 AUTH LOGIN PLAIN CRAM-MD5 " SMTP -> get_lines(): $data is "250-seisa.cu - SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 250 AUTH LOGIN PLAIN CRAM-MD5 " SMTP -> FROM SERVER250-seisa.cu SMTP Server 250-STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 2097152 250 AUTH LOGIN PLAIN CRAM-MD5 SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 " SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 " SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "235 ok, go ahead (#2.0.0) " SMTP -> get_lines(): $data is "235 ok, go ahead (#2.0.0) " SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok " SMTP -> get_lines(): $data is "250 ok " SMTP -> FROM SERVER250 ok SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok " SMTP -> get_lines(): $data is "250 ok " SMTP -> FROM SERVER250 ok SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "354 go ahead " SMTP -> get_lines(): $data is "354 go ahead " SMTP -> FROM SERVER354 go ahead SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "250 ok 1238529632 qp 14642 " SMTP -> get_lines(): $data is "250 ok 1238529632 qp 14642 " SMTP -> FROM SERVER250 ok 1238529632 qp 14642 SMTP -> get_lines(): $data was "" SMTP -> get_lines(): $str is "221 seisa.cu - SMTP Server " SMTP -> get_lines(): $data is "221 seisa.cu - SMTP Server " SMTP -> FROM SERVER221 seisa.cu SMTP Server 
Warning
Cannot modify header information headers already sent by (output started at C:wampwwwReportesSeisaPaginasphpmailerclass.smtp.php:1027in C:wampwwwReportesSeisaPaginasRegistrarReporte.php on line 58

Fatal error
Cannot redeclare class Reportes in C:wampwwwReportesSeisaPaginasclases.php on line 10 
El codigo me va quedando asi
Código PHP:
 require("phpmailer/class.phpmailer.php");
    
$mail = new PHPMailer();
    
//$mail->PluginDir="C:/wamp/www/ReportesSeisa/Paginas/phpmailer/class.smtp.php";
    
$mail->Mailer="smtp";
    
$mail->IsSMTP();
    
$mail->Host "192.168.0.3";
    
$mail->Port="25";
    
$mail->Username "email";
    
$mail->Password "yanuarys";   
    
$mail->SMTPAuth true;
    
$mail->CharSet "UTF-8";
    
$mail->From "email";
    
$mail->FromName "Reportes Seisa";
    
//$mail->IsHTML(true);
    
$mail->Subject "Nuevo Reporte";
    
$mail->AltBody "Debe visitar el sitio para asignar un nuevo reporte";
    
//$mail->ErrorInfo();
    //$mail->AddEmbeddedImage('logo.gif','my-logo');
    //$mail->AddEmbeddedImage('bg.gif','my-bg');
    /* Destinatarios */
    
$mail->AddAddress("email","Gerencia Informatica");
    
$mail->Send(); 

Última edición por GatorV; 31/03/2009 a las 12:54
  #8 (permalink)  
Antiguo 01/04/2009, 08:04
 
Fecha de Ingreso: noviembre-2008
Mensajes: 43
Antigüedad: 15 años, 5 meses
Puntos: 0
Respuesta: Problema con la funcion PHPMailer

Por favor nadie me puede ayudar por favor necesito ayuda.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:12.