Ver Mensaje Individual
  #38 (permalink)  
Antiguo 28/02/2012, 21:07
Avatar de gildus
gildus
 
Fecha de Ingreso: agosto-2003
Mensajes: 1.495
Antigüedad: 20 años, 9 meses
Puntos: 105
Respuesta: recuperar contraseña mediante un email de sistema de usuarios

Seria asi:

Código PHP:
Ver original
  1. <?php
  2.  
  3. require_once('phpMailer/class.phpmailer.php');
  4. require_once("phpMailer/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.      
  12.   $mail->Host       = "smtp.live.com"; // SMTP server
  13.   $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  14.   $mail->SMTPAuth   = true;                  // enable SMTP authentication
  15.   $mail->Host       = "smtp.live.com"; // sets the SMTP server
  16.  
  17.   $mail->SMTPSecure = "tls";
  18.   $mail->Port       = 25;                    // set the SMTP port for the GMAIL server
  19.   $mail->Username   = "[email protected]"; // SMTP account username
  20.   $mail->Password   = "oscarydiana";        // SMTP account password
  21.   $mail->AddReplyTo('[email protected]', 'oscar');
  22.   $mail->AddAddress('[email protected]', 'oscar');
  23.   $mail->SetFrom('[email protected]', 'oscar');
  24.   $mail->AddReplyTo('[email protected]', 'oscar');
  25.   $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  26.   $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  27.   $mail->MsgHTML("Hola <b>mundo</b>");
  28.   $mail->Send();
  29.   echo "Message Sent OK<p></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.  
  36.  
  37. ?>

Y habilita el openssl en tu php.ini (php_openssl.dll) y cuando reinicies tu servidor verifica con un phpinfo que este instalado.

Saludos
__________________
.: Gildus :.