Ver Mensaje Individual
  #9 (permalink)  
Antiguo 16/03/2011, 16:11
ism89
 
Fecha de Ingreso: febrero-2011
Mensajes: 7
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Problemas con PHPmailer

Adjunto nuevamente el codigo por si acaso:

Código:
try {

require_once('class.phpmailer.php');

echo"archivos cargados";

$mail = new PHPMailer(true); 
$mail->IsSMTP(); 
echo"\nCreando Instancias";

echo"\nIniciando configuración";

    $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   = "mipass";            // GMAIL password
  $mail->AddReplyTo('[email protected]', 'First Last');
  $mail->AddAddress('[email protected]', 'ISmael Ramos');
  $mail->SetFrom('[email protected]', 'First Last');
  $mail->AddReplyTo('[email protected]', 'First Last');
  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  
  echo"\nadjuntando archivos";
  $mail->MsgHTML(file_get_contents('contenido.html'));
  $mail->AddAttachment('img/arrow-square.gif');      
  $mail->AddAttachment('img/arrow.gif'); 
  $mail->Send();
  echo"\nFin bloque de codigo";
  
  echo "Message Sent OK\n";
} catch (phpmailerException $e) {
  echo $e->errorMessage(); 
} catch (Exception $e) {
  echo $e->getMessage(); 
}