Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/03/2011, 10:46
dunga007
 
Fecha de Ingreso: febrero-2009
Mensajes: 151
Antigüedad: 16 años
Puntos: 1
Respuesta: Problema extrañisimo con phpmailer

Cita:
Iniciado por pateketrueke Ver Mensaje
¿porque no muestras el famoso código desconocido de funciones.php?
Si!, no hay ningun problema, no tiene nada extraordinario, es lo mismo de siempre, esta seria la funcion phpmailer:

Código PHP:
function phpmailer(){
         
        global 
$mail;
        
        require(
"phpmailer/class.phpmailer.php");
        
$mail = new PHPMailer(true);
        
$mail->IsSMTP();
        try {
            
$mail->SMTPDebug  2;
            
$mail->CharSet   "UTF-8";                  // enable SMTP authentication
            
$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   "uduario";  // GMAIL username
            
$mail->Password   "contraseña";            // GMAIL password
            
$mail->AddReplyTo('responder a');

              
$mail->SetFrom('de');
              
$mail->Timeout=30;
              
$mail->ClearAddresses();
              
$mail->MsgHTML($body);

              
            } catch (
phpmailerException $e) {
              echo 
$e->errorMessage(); //Pretty error messages from PHPMailer
            
} catch (Exception $e) {
              echo 
$e->getMessage(); //Boring error messages from anything else!
        
}


Obiamente tanto

Código HTML:
          $mail->AddAddress("");

	  $mail->Subject = "";
	  
	  $mail->Body ="";
	  
	  $mail->Send();
Las seteo cuando llamo a la funcion phpmailer, porque para cada caso cambia.