Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2013, 07:42
ofertasdiarias
 
Fecha de Ingreso: marzo-2011
Mensajes: 115
Antigüedad: 13 años, 1 mes
Puntos: 0
comentar publicacion y mandar mail

Buenas, mi nombre es Fernando., y ando en busca de vuestra ayuda.

estoy haciendo esta pagina web : [URL="http://www.hoysale.com"]http://www.hoysale.com[/URL] la cual es de anuncios clasificados.

tengo el siguiente inconveniente : cuando los usuarios comentan una publicacion por ejemplo :[URL="http://www.hoysale.com/detalles.php?ver=1#.UaYEm9jPbIX"]http://www.hoysale.com/detalles.php?ver=1#.UaYEm9jPbIX[/URL] , he logrado que se envien los mensajes correctamente a la misma pagina : [URL="http://www.hoysale.com/mensajes.php#.UaYFxdjPbIU"]http://www.hoysale.com/mensajes.php#.UaYFxdjPbIU[/URL] , pero no eh logrado conseguir que se le pueda avisar al usuario a su mail que tiene un nuevo comentario..

tengo este script :
Código PHP:
Ver original
  1. <?php
  2. require_once('PHPMailer_v5.1/class.phpmailer.php');
  3. require_once('PHPMailer_v5.1/class.smtp.php');
  4. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  5.  
  6. $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
  7.  
  8. $mail->IsSMTP(); // telling the class to use SMTP
  9.  
  10. try {
  11.   $mail->Host       = "smtp"; // SMTP server
  12.   $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  13.   $mail->SMTPAuth   = true;                  // enable SMTP authentication
  14.   $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
  15.   $mail->Host       = "smtp";      // sets GMAIL as the SMTP server
  16.   $mail->Port       = 25;                   // set the SMTP port for the GMAIL server
  17.   $mail->Username   = "[email protected]";  // GMAIL username
  18.   $mail->Password   = "xxxxxxx";            // GMAIL password
  19.   $mail->AddReplyTo('[email protected]', 'First Last');
  20.   $mail->AddAddress('[email protected]');
  21.   $mail->SetFrom('[email protected]', 'First Last');
  22.   $mail->AddReplyTo('[email protected]', 'First Last');
  23.   $mail->Subject = 'Haz recibido un mensaje nuevo.';
  24.   $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  25.   $mail->MsgHTML('$mensaje');
  26.   $mail->AddAttachment('PHPMailer_v5.1/examples/images/phpmailer.gif');      // attachment
  27.   $mail->AddAttachment('PHPMailer_v5.1/examples/images/phpmailer_mini.gif'); // attachment
  28.   $mail->Send();
  29.   echo "Mensaje enviado </p>\n";
  30. } catch (phpmailerException $e) {
  31.   echo $e->errorMessage(); //Pretty error messages from PHPMailer
  32. } catch (Exception $e) {
  33.   echo $e->getMessage(); //Boring error messages from anything else!
  34. }
  35. ?>


si alguien me puede orientar o ayudar muy agradecido