Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/04/2010, 07:23
Avatar de ASCENDEDMASTERS
ASCENDEDMASTERS
 
Fecha de Ingreso: julio-2005
Ubicación: Pergamino, Buenos Aires
Mensajes: 302
Antigüedad: 18 años, 10 meses
Puntos: 1
Modificar PHPMailer porque imprime valores

Hola, me he bajado el ultimo phpmailer para php5/6 y en los ejemplos hice el que trae para ver si puedo enviar mails con una cuenta de gmail pero le problema es que me imprime valores, ya anule lineas con // que tenian usando "echo" pero tampoco solucionó el asunto esto. el ejemplo que tengo usando es:

Código PHP:
<?php
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

$mail->IsSMTP(); // telling the class to use SMTP

//try {
  
$mail->Host       "mail.yourdomain.com"// SMTP server
  
$mail->SMTPDebug  2;                     // enables SMTP debug information (for testing)
  
$mail->SMTPAuth   true;                  // enable SMTP authentication
  
$mail->SMTPSecure "tls";                 // sets the prefix to the servier
  
$mail->Host       "smtp.gmail.com";      // sets GMAIL as the SMTP server
  
$mail->Port       587;                   // set the SMTP port for the GMAIL server
  
$mail->Username   "[email protected]";  // GMAIL username
  
$mail->Password   "xxxxxxx";            // GMAIL password
  //$mail->AddReplyTo('[email protected]', 'First Last');
  
$mail->AddAddress('[email protected]''John Doe');
  
$mail->SetFrom('[email protected]''local');
  
$mail->AddReplyTo('[email protected]''First Last');
  
$mail->Subject 'Activación de tu cuenta en xxxxxx.com';
  
$mail->AltBody 'To view the message, please use an HTML compatible email viewer!'// optional - MsgHTML will create an alternate automatically
  
$mail->MsgHTML(file_get_contents('contents.html'));
  
$mail->AddAttachment('images/phpmailer.gif');      // attachment
  
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
    
if(!$mail->Send())
          echo 
$mail->ErrorInfo.'<br><br>';
    else
        echo 
"Message Sent OK</p>\n";
/*} catch (phpmailerException $e) {
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}*/
?>

enviar el mail lo hace perfectamente, todo de maravillas, pero el problema es que cuando me deberia devolver solo un mensaje

Código:
Message Sent OK

me muestra esto:
Código:
SMTP -> FROM SERVER:220 mx.google.com ESMTP v26sm3084793qce.7
SMTP -> FROM SERVER: 250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35651584 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250 PIPELINING
SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS
SMTP -> FROM SERVER: 250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35651584 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH 250-ENHANCEDSTATUSCODES 250 PIPELINING
SMTP -> FROM SERVER:250 2.1.0 OK v26sm3084793qce.7
SMTP -> FROM SERVER:250 2.1.5 OK v26sm3084793qce.7
SMTP -> FROM SERVER:354 Go ahead v26sm3084793qce.7
SMTP -> FROM SERVER:250 2.0.0 OK 1270905208 v26sm3084793qce.7
Message Sent OK 


Como dije arriba al principio, yo salve 5 lineas con //, y son:

#454
#464
#496
#586
#1370

del archivo class.phpmailer.php (ocupa 76kb en disco y tiene un total de 2320 lineas el archivo. PHPMailer v5.1



Como puedo hacer para que solo imprima si yo quieor nada mas, cosa de poder usar este codigo en mi sitio para enviar los emails desde gmail redireccionados? Muchas Gracias por la ayuda. Leonardo.
__________________
Dios es la unica fuente de todo bien.