Ver Mensaje Individual
  #36 (permalink)  
Antiguo 28/02/2012, 19:20
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Respuesta: recuperar contraseña mediante un email de sistema de usuarios

hola amigos este es mi codigo pero no me funciona

Código PHP:
Ver original
  1. require_once('phpMailer/class.phpmailer.php');
  2. require_once("phpMailer/class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  3.  
  4. $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
  5.  
  6. $mail->IsSMTP(); // telling the class to use SMTP
  7.  
  8.   try {
  9.   $mail->Host       = "smtp.live.com"; // SMTP server
  10.   $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  11.   $mail->SMTPAuth   = true;                  // enable SMTP authentication
  12.   //$mail->Host       = "mail.yourdomain.com"; // sets the SMTP server
  13.  
  14.   $mail->SMTPSecure = "tls";
  15.   $mail->Port       = 25;                    // set the SMTP port for the GMAIL server
  16.   $mail->Username   = "[email protected]"; // SMTP account username
  17.   $mail->Password   = "oscarydiana";        // SMTP account password
  18.   $mail->AddReplyTo('[email protected]', 'oscar');
  19.   $mail->AddAddress('[email protected]', 'oscar');
  20.   $mail->SetFrom('[email protected]', 'oscar');
  21.   $mail->AddReplyTo('[email protected]', 'oscar');
  22.   $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  23.   $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  24.   $mail->MsgHTML("Hola <b>mundo</b>");
  25.   $mail->Send();
  26.   echo "Message Sent OK<p></p>\n";
  27. } catch (phpmailerException $e) {
  28.   echo $e->errorMessage(); //Pretty error messages from PHPMailer
  29. } catch (Exception $e) {
  30.   echo $e->getMessage(); //Boring error messages from anything else!
  31. }